/etc/network/interfaces file [message #36069] |
Tue, 19 May 2009 06:49 |
Balbuzard
Messages: 26 Registered: March 2009 Location: Australia
|
Junior Member |
|
|
Hey,
I have had a look at the /etc/network/interfaces file in a VPS, and I am surprised by the values of the netmask and the broadcast
255.255.255.255 for the netmask and 0.0.0.0 for the gateway.
I have tried to modify these values for more realistic ones
255.255.255.0 for the netmask and 192.168.10.255 for the broadcast, but then, I can not change the IP values with the vzctl command. And it becomes impossible to do live migration too.
Here is the content of the /etc/network/interfaces file
# Auto generated interfaces
auto lo
iface lo inet loopback
auto venet0
iface venet0 inet static
address 127.0.0.1
netmask 255.255.255.255
broadcast 0.0.0.0
up route add -net 192.0.2.1 netmask 255.255.255.255 dev venet0
up route add default gw 192.0.2.1
auto venet0:0
iface venet0:0 inet static
address 192.168.10.126
netmask 255.255.255.255
broadcast 0.0.0.0
gateway 192.168.10.1
I don't understand why there are two blocs (one for venet0 and the second one for venet0:0)
And why are these values for netmask and broadcast set like this?
To finish with, I have added the IP-address of the gateway in this file, but after checking, it is not needed! It should however be set somewhere, the VPS can not establish an internet connection without the gateway address?
Thank you for your answers and help, and sorry for my bad English!
[Updated on: Tue, 19 May 2009 08:07] Report message to a moderator
|
|
|
|
|
Re: /etc/network/interfaces file [message #36150 is a reply to message #36090] |
Mon, 25 May 2009 07:20 |
maratrus
Messages: 1495 Registered: August 2007 Location: Moscow
|
Senior Member |
|
|
This file as it is mentioned in its first line is auto generated file. AFAIK it based on VEs configuration file, so you cannot assign a permanent ip address from inside the VE because after a VE reboots all settings will be cleared and will be taken from VEs configuration file.
If you are planning to use DHCP, you'd better take a look at veth interface instead of venet0. IMHO, bridge mode would suit you.
http://wiki.openvz.org/Veth
There are some people who tried DHCP and managed to do it. You may search through the forum if you want.
[Updated on: Mon, 25 May 2009 07:35] Report message to a moderator
|
|
|