OpenVZ Forum


Home » General » Support » Network Interfaces Configuration
Network Interfaces Configuration [message #34463] Wed, 07 January 2009 19:01 Go to next message
laotse is currently offline  laotse
Messages: 35
Registered: December 2008
Member
Hi there,

I have a VE using veth and bridging, which works fine. However, after reboot, the veth interface is down and the old venet interface is there instead. Since I have already done --ipdel, this venet has some internal address, but wins the default route.

I edited /etc/network/interfaces.template as shown below:

auto eth0
iface eth0 inet static
        address 172.16.8.7
        netmask 255.255.255.0
        up route add default gw 172.16.8.1

auto eth3
iface eth3 inet static
        address 172.16.2.1
        netmask 255.255.255.0


However, after reboot the following /etc/network/interfaces is found in the container, which has eth3 but lacks eth0.

# This configuration file is auto-generated.
# WARNING: Do not edit this file, otherwise your changes will be lost.
# Please edit template /etc/network/interfaces.template instead.
auto eth3
iface eth3 inet static
        address 172.16.2.1
        netmask 255.255.255.0
# 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


How do I get rid of venet0 and have eth0 instead?

Regards,
- lars.
Re: Network Interfaces Configuration [message #34496 is a reply to message #34463] Mon, 12 January 2009 16:30 Go to previous messageGo to next message
ulver is currently offline  ulver
Messages: 12
Registered: July 2008
Junior Member
Hello,

You have maybe a line IP_ADDRESS in your /etc/vz/conf/xxx.conf ?

If you have already done --ipdel with the ip address, it's strange, unless you forgot the --save option when you did it.

(sorry for my bad english).
Re: Network Interfaces Configuration [message #34498 is a reply to message #34496] Mon, 12 January 2009 19:13 Go to previous messageGo to next message
laotse is currently offline  laotse
Messages: 35
Registered: December 2008
Member
You have maybe a line IP_ADDRESS in your /etc/vz/conf/xxx.conf ?

Actually, I had an empty entry in the file after --ipdel and --save. But I commented it manually, which did not change the behaviour.
Re: Network Interfaces Configuration [message #34499 is a reply to message #34463] Mon, 12 January 2009 19:37 Go to previous messageGo to next message
ulver is currently offline  ulver
Messages: 12
Registered: July 2008
Junior Member
Hmmm, it is strange.

When I don't have any IP_ADDRESS in my conf file, i can modify the /etc/network/interfaces in the VPS (debian), and if i reboot, the change is persistent.

But, when you use veth, do you still use the .template file ?
Maybe i'm wrong, but with veth, you have to use /etc/network/interfaces directly (in the vps).

So, delete any mention of IP_ADDRESS in the vps conf (on the HN), and change manually the /etc/network/interfaces in the VPS instead of the .template.

I think it will be good Smile
Re: Network Interfaces Configuration [message #34500 is a reply to message #34463] Mon, 12 January 2009 19:41 Go to previous message
januszzz is currently offline  januszzz
Messages: 50
Registered: January 2007
Location: Opole, Poland
Member
Have you got Gentoo as your VE?

With OpenRC-0.4.1 it defaults to hotplug interfaces and it finds venet0 and assigns ip address from dhcp.

To solve this you need to edit /etc/rc.conf and disable hotplugging the venet0 device:

rc_hotplug="!net.venet0"
Previous Topic: df: `/': No such device
Next Topic: VEs sharing an IP address?
Goto Forum:
  


Current Time: Mon Nov 04 13:33:54 GMT 2024

Total time taken to generate the page: 0.03457 seconds