Using NetworkManager, I am trying to setup multiple interfaces on different VLANs; the primary interface, em1, is used on a development VLAN; the secondary interface is on a dedicated iSCSI VLAN.
I am using kernel arguments to launch the host from an iSCSI disk:
GRUB_CMDLINE_LINUX="netroot=iscsi:@172.16.250.250::3260:em2:::iqn.2000-01.com.example.san:disk rd.iscsi.initiator=iqn.2000-01.com.example.node:root rd.lvm.lv=centos/root
To prevent dracut from overriding changes to network config files, I added an override to the dracut config file, the rebuilt:
echo 'omit_dracutmodules+="ifcfg"' >> /etc/dracut.conf
dracut -f
grub2-mkconfig -o /boot/grub2/grub.cfg
After a reboot, I used nmtui
to configure the adapters, this built config files with these parameters:
DEVICE= em1 em2
ONBOOT= yes yes
BOOTPROTO= dhcp dhcp
DEFROUTE= yes no
PEERDNS= no
PEERROUTES= no
I need em1 to be the primary / default interface, em2 is to dedicated to iSCSI; the issue however is that em2 is still adding default routes. After a reboot:
$ ip route show
default via 172.16.250.1 dev em2 <-- WRONG
default via 172.16.100.1 dev em1 proto dhcp metric 100
172.16.100.0/24 dev em1 proto kernel scope link src 172.16.100.100
172.16.100.0/24 dev em1 proto kernel scope link src 172.16.100.100 metric 100
172.16.250.0/24 dev em2 proto kernel scope link src 172.16.250.100
172.16.250.0/24 dev em2 proto kernel scope link src 172.16.250.100 metric 101
There are no route- config files.
Here are some related nmcli options:
$ nmcli c show $if | grep ipv4
em1 em2
ipv4.routes -- --
ipv4.route-metric -1 -1
ipv4.route-table 0 (unspec) 0 (unspec)
ipv4.routing-rules -- --
ipv4.ignore-auto-routes no yes
ipv4.ignore-auto-dns no yes
ipv4.never-default no yes
I am not certain what is generating this extra route, how can I check what is creating it and prevent it?