The default gateway entry on VLAN interface disappears when the real interface is restarted by ifdown and ifup.
Issue
-
The default gateway entry on VLAN interface disappears when the interface is restarted by ifdown and ifup.
-
Create VLAN interface, and set default gateway on the interface
# ifconfig | grep -A1 eth
eth0 Link encap:Ethernet HWaddr 00:1A:4A:40:DC:F6
inet addr:10.64.221.199 Bcast:10.64.221.255 Mask:255.255.255.0
--
eth1 Link encap:Ethernet HWaddr 00:1A:4A:40:DC:F9
inet addr:10.64.100.20 Bcast:10.64.100.255 Mask:255.255.255.0
--
eth1.110 Link encap:Ethernet HWaddr 00:1A:4A:40:DC:F9
inet addr:10.64.110.3 Bcast:10.64.110.255 Mask:255.255.255.0
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.64.100.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
10.64.110.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1.110
10.64.221.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1.110
0.0.0.0 10.64.110.1 0.0.0.0 UG 0 0 0 eth1.110
- After ifdown and ifup the real interface, the entry for the default gateway disappears.
# ifdown eth1; ifup eth1
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.64.100.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
10.64.110.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1.110
10.64.221.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
- Restarting network instead of using ifdown and ifup, the entry for the default gateway will be retrieved.
# service network restart
Shutting down interface eth1.110: Removed VLAN -:eth1.110:-
[ OK ]
Shutting down interface eth0: [ OK ]
Shutting down interface eth1: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Setting 802.1Q VLAN parameters: Set name-type for VLAN subsystem. Should be visible in /proc/net/vlan/config
[ OK ]
Bringing up interface eth0: [ OK ]
Bringing up interface eth1: [ OK ]
Bringing up interface eth1.110: Added VLAN with VID == 110 to IF -:eth1:-
[ OK ]
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.64.100.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
10.64.110.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1.110
10.64.221.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1.110
0.0.0.0 10.64.110.1 0.0.0.0 UG 0 0 0 eth1.110
Environment
- Red Hat Enterprise Linux 5.5
- initscripts-8.45.30-2.el5.x86_64
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.