OpenVZ Forum


Home » General » Support » vServer sets venet although it shouldn't
vServer sets venet although it shouldn't [message #35608] Wed, 08 April 2009 10:54 Go to next message
divB is currently offline  divB
Messages: 79
Registered: April 2009
Member
Please look at this config:

# cat /etc/vz/conf/201.conf | grep -v '^#'
ONBOOT="no"
KMEMSIZE="11055923:11377049"
LOCKEDPAGES="256:256"
PRIVVMPAGES="65536:69632"
SHMPAGES="21504:21504"
NUMPROC="240:240"
PHYSPAGES="0:2147483647"
VMGUARPAGES="33792:2147483647"
OOMGUARPAGES="26112:2147483647"
NUMTCPSOCK="360:360"
NUMFLOCK="188:206"
NUMPTY="16:16"
NUMSIGINFO="256:256"
TCPSNDBUF="1720320:2703360"
TCPRCVBUF="1720320:2703360"
OTHERSOCKBUF="1126080:2097152"
DGRAMRCVBUF="262144:262144"
NUMOTHERSOCK="360:360"
DCACHESIZE="3409920:3624960"
NUMFILE="9312:9312"
AVNUMPROC="180:180"
NUMIPTENT="128:128"
DISKSPACE="1048576:1153024"
DISKINODES="200000:220000"
QUOTATIME="0"
CPUUNITS="1000"
OSTEMPLATE="debian-lenny"
IP_ADDRESS=""
NETIF="ifname=eth0,mac=00:18:51:AC:AA:BF,host_ifname=veth201.0,host_mac=00:18:51:6A:B9:15"
# ip addr | grep 112
#
# vzctl start 201
Starting VE ...
VE is mounted
Setting CPU units: 1000
Configure meminfo: 65536
Configure veth devices: veth201.0
VE start in progress...
# vzctl enter 201
## ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:168 (168.0 b)  TX bytes:168 (168.0 b)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:127.0.0.1  P-t-P:127.0.0.1  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

venet0:0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:192.168.200.112  P-t-P:192.168.200.112  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
## ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:18:51:AC:AA:BF
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:336 (336.0 b)  TX bytes:336 (336.0 b)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:127.0.0.1  P-t-P:127.0.0.1  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

venet0:0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:192.168.200.112  P-t-P:192.168.200.112  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1


WhereTF does the IP come from?!?!

At the beginning, I added 192.168.200.112 to the VServer with --ipadd. But then I removed it with --ipdel and added a veth with --addif_net, as you can see in the config.

I grepped through everything in /etc and /vz but I simply can't find any reference to this **** IP.

Does anybody have an idea where the configured veth devices come from, including the IP?

Maybe I do not understand the concept yet...

Thank you,
divB
Re: vServer sets venet although it shouldn't [message #35610 is a reply to message #35608] Wed, 08 April 2009 12:51 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hi,

check this bug please
http://bugzilla.openvz.org/show_bug.cgi?id=478
Re: vServer sets venet although it shouldn't [message #35613 is a reply to message #35608] Wed, 08 April 2009 13:47 Go to previous messageGo to next message
divB is currently offline  divB
Messages: 79
Registered: April 2009
Member
Thank you for pointing me.

1st) Is this issue solved already (seems to be open since Feb 2007). Or is it because I'm using Debian lenny?

2nd) I see. But where are the settings stored? Somewhere there must be a file containing "192.168.200.112". And somehow it must be possible to remove it. How? The problem persists on reboots...

Thank you, Regards,
divB
Re: vServer sets venet although it shouldn't [message #35616 is a reply to message #35613] Wed, 08 April 2009 14:05 Go to previous messageGo to next message
divB is currently offline  divB
Messages: 79
Registered: April 2009
Member
I think I have found it. It's rather set inside the networking config in the VE itself (and not the host!).

But I do not understand this: Normally the the VE should not be able to assign itself an IP address if it is not set by the host?! This would mean I could just do an "ifconfig venet0:0 192.168.200.113 netmask 255.255.255.0 up" inside my VE and have another IP address?!

And what is exactly the loopback interface inside a VE? Is it lo or is it "venet0"? I ask because venet0 is assigned 127.0.0.1.

This is the file OpenVZ obviously created inside the VE (I even do not understand where the 192.0.2.x come from):

# 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 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.200.112
	netmask 255.255.255.255
	broadcast 0.0.0.0


Regards,
divB

Re: vServer sets venet although it shouldn't [message #35623 is a reply to message #35616] Thu, 09 April 2009 06:07 Go to previous message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hello,

Quote:


I think I have found it. It's rather set inside the networking config in the VE itself (and not the host!).

But I do not understand this: Normally the the VE should not be able to assign itself an IP address if it is not set by the host?! This would mean I could just do an "ifconfig venet0:0 192.168.200.113 netmask 255.255.255.0 up" inside my VE and have another IP address?!


No, this configuration file is generated every time VE is starting.
Quote:


WARNING: Do not edit this file, otherwise your changes will be lost.



So, if you bump into the problem described in bug #478 try to start VE and then remove that ip address.
So, in case of venet0 interface you are not permitted to make permanent changes. During the next start process, information will be read from VEs configuration file.

Quote:


And what is exactly the loopback interface inside a VE? Is it lo or is it "venet0"? I ask because venet0 is assigned 127.0.0.1.


Loopback is a loopback interface and venet0 is a venet interface Smile
Assigning 127.0.0.1 to venet0 interface is just a convenient way to treat with networking inside VE. Don't worry, it doesn't break anything.
Previous Topic: How to rebuild a openvz kernel in linux kernel with version 2.6.24.7 ?
Next Topic: kernel 2.6.27-openvz fails to compile
Goto Forum:
  


Current Time: Sun Jul 14 13:45:29 GMT 2024

Total time taken to generate the page: 0.02477 seconds