Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 5956

Convert interfaces to netplan with complex routing

$
0
0

I have the interfaces configuration below from my 18.04 ubuntu server. It has 2 network interfaces that are on different VLANs of the same network. I'm now migrating the server to a new one with ubuntu 24.04 which uses netplan.. How can I convert the config below to netplan? I've tried some suggestions online but have found nothing definitive so far...

    # This file describes the network interfaces available on your system    # and how to activate them. For more information, see interfaces(5).    source /etc/network/interfaces.d/*    # The loopback network interface    auto lo    iface lo inet loopback    # The primary network interaface    #auto eno1    allow-hotplug eno1    iface eno1 inet static     address 10.10.99.3     netmask 255.255.255.0     network 10.10.99.0     broadcast 10.10.99.255     gateway 10.10.99.254    # dns-* options are implemented by the resolvconf package, if installed     dns-nameservers 10.10.1.3 10.10.1.1 10.5.1.1 10.6.1.4     dns-search mgmonitor02.central2.local central2.local     post-up ip route add 10.0.0.0/16 eno1 src 10.10.99.3 table rt1     post-up ip route add default via 10.10.99.254 dev eno1 table rt1     post-up ip rule add from 10.10.99.3/32 table rt1     post-up ip rule add to 10.10.99.3/32 table rt1    allow-hotplug ens6    iface ens6 inet static     address 10.0.0.7     netmask 255.255.0.0     network 10.0.0.0     broadcast 10.0.255.255     # gateway 10.0.0.1     # dns-* options are implemented by the resolvconf package, if installed     dns-nameservers 10.10.1.3 10.10.1.1 10.5.1.1 10.6.1.4     dns-search mgmonitor02.central2.local central2.local     post-up ip route add 10.0.0.0/16 dev ens6 src 10.0.0.7 table rt2     post-up ip route add default via 10.0.0.1 dev ens6 table rt2     post-up ip rule add from 10.0.0.7/32 table rt2     post-up ip rule add to 10.0.0.7/32 table rt2     post-up ip route add 10.0.0.4 via 10.0.0.1 dev ens6

I tried to convert using some exapmple configs that found online but I always get errors.... This is my current netplan:

    # This file is generated from information provided by the datasource.  Changes    # to it will not persist across an instance reboot.  To disable cloud-init's    # network configuration capabilities, write a file    # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:    # network: {config: disabled}        network:          ethernets:            ens18:                addresses:                - 10.0.0.7/16                nameservers:                    addresses:                    - 10.10.1.3                    - 10.10.1.2                    - 10.5.1.1                    - 10.6.1.4                    - 8.8.8.8                    search:                    - central2.local                routes:                -   to: default                    via: 10.0.0.1            ens19:                addresses:                - 10.10.99.3/24                nameservers:                    addresses:                    - 10.10.1.3                    - 10.10.1.2                    - 10.5.1.1                    - 10.6.1.4                    - 8.8.8.8                    search:                    - central2.local                routes:                -   to: default                    via: 10.10.99.254        version: 2

Viewing all articles
Browse latest Browse all 5956

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>