[Users] Default Gateway not set at boot in VM vz7

Jehan Procaccia jehan.procaccia at tem-tsp.eu
Mon Sep 12 05:32:29 PDT 2016


Hello,

I created a centos7 VM  on an openvz 7 host :

# cat /etc/redhat-release
Virtuozzo Linux release 7.2

inside the VM I did set a default gateway
# cat /etc/sysconfig/network
GATEWAY=192.168.5.1

(set it also in /etc/sysconfig/network-scripts/ifcg-eth0)

But after the VM boots, there is no default route at startup :-(


bash-4.2# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window irtt 
Iface
192.168.5.0    0.0.0.0         255.255.255.0   U         0 0          0 eth0
192.168.122.0   0.0.0.0         255.255.255.0   U         0 0          0 
virbr0

if I set it manually it does work

bash-4.2# route add default gw 192.168.5.1
bash-4.2# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window irtt 
Iface
0.0.0.0         192.168.5.1    0.0.0.0         UG        0 0          0 eth0
...

  what could be wrong ?

Regards .


More information about the Users mailing list