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

zystem at zystem.pp.ua zystem at zystem.pp.ua
Tue Sep 13 13:20:20 PDT 2016


Use 
prlctl set VMName  --gw 10.1.0.1

OR

See https://kb.plesk.com/en/126614 to prevent IP configuration in guest OS from hypervisor level

via command line

--configure <yes|no> option for prlctl set [--device-set|--divice-add] net designates if IP settings given in the config will be applied on every start of the virtual machine

The following list of options will not be automatically passed to the guest OS if --configure no is configured:

ipadd: the IP address to be assigned to the network adapter in the virtual machine.

dhcp: specifies whether the virtual network adapter should get its IP settings through a DHCP server.

dhcp6: specifies whether the virtual network adapter should get its IPv6 settings through a DHCP server.

gw: the default gateway to be used by the virtual machine.

gw6: the default IPv6 gateway to be used by the virtual machine.

nameserver: the default DNS server to be used by the virtual machine.

searchdomain: the default search domain to be used by the virtual machine.

For example, to add the network interface with IP settings synchronization disabled:
prlctl set VMName --device-add net --network Bridged --ipadd 10.0.1.3 --gw 10.1.0.1 --configure no  

Note: By default, configuring any of the settings above automatically sets --configure option to "yes".

12.09.2016, 16:56, "Jehan Procaccia" <jehan.procaccia at tem-tsp.eu>:
> 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 .
> _______________________________________________
> Users mailing list
> Users at openvz.org
> https://lists.openvz.org/mailman/listinfo/users


More information about the Users mailing list