OpenVZ Forum


Home » General » Support » /etc/network/interfaces file
/etc/network/interfaces file [message #36069] Tue, 19 May 2009 06:49 Go to next message
Balbuzard is currently offline  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 #36083 is a reply to message #36069] Wed, 20 May 2009 11:59 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Don't worry, the only thing you have to pay attention is that a network packet going outside must reach venet0 interface. A next hop is always your HN so if a packet reaches venet0 it will be processed by venet0 driver properly.
Re: /etc/network/interfaces file [message #36090 is a reply to message #36083] Thu, 21 May 2009 04:15 Go to previous messageGo to next message
Balbuzard is currently offline  Balbuzard
Messages: 26
Registered: March 2009
Location: Australia
Junior Member
Ok, thanks for your answer.
But what happens if I want to set up a private dynamic network for my VPS? Is it still possible to set up a DNS server and a DHCP server (with dnsmasq for example) with this configuration?
I have tried previously without any success, I don't know if the problem comes from this configuration. I had this in the file /etc/network/interfaces of the VPS:
# 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 dhcp

Thank you for your help!
Re: /etc/network/interfaces file [message #36150 is a reply to message #36090] Mon, 25 May 2009 07:20 Go to previous message
maratrus is currently offline  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

Previous Topic: bridging work one-way only
Next Topic: Time falls behind in Hardware(host) node
Goto Forum:
  


Current Time: Tue Aug 13 07:02:01 GMT 2024

Total time taken to generate the page: 0.02903 seconds