simongreenwood.me.uk/adding-an-ipv6-default-route-with-network-scripts-in-an-el8-server-at-ovh.md

52 lines
3.5 KiB
Markdown
Raw Normal View History

2025-02-08 21:47:24 +00:00
[![Simon Greenwood](/images/profile.png)](https://simongreenwood.me.uk/)
# [Simon Greenwood](https://simongreenwood.me.uk/)
Gracefully degrading
- [About Me](https://simongreenwood.me.uk/pages/about-me.html#about-me)
- [Contact info](https://simongreenwood.me.uk/pages/contact.html#contact)
- [My CV](https://simongreenwood.me.uk/pages/curriculum-vitae.html#curriculum-vitae)
- [CV Part 2](https://simongreenwood.me.uk/pages/cv-part-2.html#cv-part-2)
- [Social](https://gotosocial.grnwds.uk/@simon)
[Home](https://simongreenwood.me.uk/) [Technical](/category/technical.html) [Listening Diary](/category/listening-diary.html) [Tags](/tags.html) [Archives](/archives.html) [Atom](https://simongreenwood.me.uk/feeds/all.atom.xml)
# Adding an IPv6 default route with network-scripts in an EL8 server at OVH
Posted on Wed 06 September 2023 in [Technical](https://simongreenwood.me.uk/category/technical.html)
This is a bit of a niche one, not least because `network-scripts` is _supposed_ to be on its way out as a configuration method, despite [cPanel](https://cpanel.net) still not supporting NetworkManager properly. No problem people, it's only been around for ten years.
This may also be specific to [OVH](https://ovh.com)'s network, but I haven't found a resource that covers it, so here are my notes.
Dedicated servers at OVH are allocated a /64 IPV6 range. The gateway is the last address in the range, which is slightly more eye crossing than with IPV4, but ends in `FF:FF:FF:FF`. However, in EL8 (and in Debian-derived distros to my knowledge), ifup doesn't add a default gateway if it can't ping the address, and it can't ping the address because it needs a default gateway. This also applies to IPV4 in OVH's network, which is a pain for automatic provisioning.
The `network-scripts` system is remarkably flexible, and wrangling it is a dying art, but the key here is the `ifup-post` script. This runs after `ifcfg-<device>` and goes through a sequence of the other scripts in `/etc/sysconfig/network-scripts`\- you can see which ones if you look at the code.
One of these is `route6-<device>` and this is where you add your default route so it's added after the initial network config. In OVH images it is disabled, and perhaps confusingly, includes a list of static routes generated by cloud-init. Rename that one, and using your editor of choice (vim, you animals), open a new file `vi route6-eno1` (for example) and enter your gateway and default route like this:
```
2001:xxxx:xxxx:xxff:00ff:00ff:00ff:00ff dev eno1
default via 2001:xxxx:xxxx:xxff:00ff:00ff:00ff:00ff dev eno1
```
Enable the script by making it executable `chmod +x route6-eno1`.
and restart the network with `systemctl restart network`.
and you should now be able to ping the IPV6 host of your choice (let's face it, your local google.com gateway).
[tech](https://simongreenwood.me.uk/tag/tech.html) [Enterprise Linux](https://simongreenwood.me.uk/tag/enterprise-linux.html) [IPV6](https://simongreenwood.me.uk/tag/ipv6.html) [Linux](https://simongreenwood.me.uk/tag/linux.html) [Networking](https://simongreenwood.me.uk/tag/networking.html)
© 2025 - This work is licensed under a [Creative Commons Attribution-ShareAlike](http://creativecommons.org/licenses/by-sa/4.0/deed.en_US)
Built with [Pelican](http://getpelican.com) using [Flex](http://bit.ly/flex-pelican) theme
\|
Switch to the [dark](javascript:void(0)) \| [light](javascript:void(0)) \| [browser](javascript:void(0)) theme
[![Creative Commons License](https://i.creativecommons.org/l/by-sa/4.0/80x15.png)](http://creativecommons.org/licenses/by-sa/4.0/)