I added two options net.ifnames=0 biosdevname=0 to grub2 because I want to change the default network name to the old name eth0 on RHEL 7 .
After that, I edited /etc/sysconfig/network to set the default gateway for the machine:
GATEWAY=192.168.88.1
And a customized network interface. When I have only one eth0 network interface, everything works fine.
Here is a route table with one eth0 network interface:
[ root@devmachine ~]# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.88.1 0.0.0.0 UG 100 0 0 eth0 192.168.88.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0 [ root@devmachine ~]#
But I had a problem with the route table when there were several network interfaces on the network.
[ root@devmachine ~]# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.88.1 0.0.0.0 UG 100 0 0 eth0 0.0.0.0 192.168.88.1 0.0.0.0 UG 101 0 0 eth1 172.168.0.0 0.0.0.0 255.255.0.0 U 100 0 0 eth1 192.168.88.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0 192.168.88.1 0.0.0.0 255.255.255.255 UH 100 0 0 eth1 [ root@devmachine ~]#
As you can see, the gateway address 192.168.88.1 was added to eth1 on the last line. And the gateway address is added continuously with the new network interface.
[ root@devmachine network-scripts]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.88.1 0.0.0.0 UG 100 0 0 eth0 default 192.168.88.1 0.0.0.0 UG 101 0 0 eth1 default 192.168.88.1 0.0.0.0 UG 102 0 0 eth2 172.168.0.0 0.0.0.0 255.255.0.0 U 100 0 0 eth1 172.168.0.0 0.0.0.0 255.255.0.0 U 101 0 0 eth2 192.168.88.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0 192.168.88.1 0.0.0.0 255.255.255.255 UH 100 0 0 eth1 192.168.88.1 0.0.0.0 255.255.255.255 UH 101 0 0 eth2
Actually, the problem only occurs when I added the option net.ifnames=0 to grub2 . Someone will help me.
source share