OpenVZ Forum


Home » General » Support » *SOLVED* Trying to get IP in a laptop from a DHCP server inside a VE.
*SOLVED* Trying to get IP in a laptop from a DHCP server inside a VE. [message #11491] Sun, 25 March 2007 19:50 Go to next message
mcarreira is currently offline  mcarreira
Messages: 30
Registered: February 2007
Member
I have a problem that I can't solve without some help.
My HN has 3 NIC's. But for now, let's only think about one of them (eth2).

                                                  
	 ---------------                                   eth0
	| Laptop        |                   ---------------------------------------
	|192.168.30.121 |  ------------  eth2               VE0                    eth0
	 ---------------     192.168.30.254|                                       |
	                                    ---------------------------------------
		                                |          |                 |
		                            veth400.0  +  br0              venet0
		                                |          |                 |
		                                ------------------     -------------------
		                                |     eth0        |    |    venet0:0      |
		                                |  192.168.30.53  |    |   192.168.30.22  |
		                                |                 |    |                  |
		                                |     VE400       |    |     VE200        |
		                                ------------------      ------------------
                                
  
                                        



I Created a veth in VE400 and then a bridge using only veth400.0.
This is the way I found in the wiki and forum to setup a VE which is going to be a DHCP server.
After setting up the bridge I can ping from the laptop to VE400 and from VE400 to the laptop.
I also can ssh both sides.
But when I run a DHCP server inside VE400, and I configure the laptop NIC to aquire the ip with dhcp, it doesn't work.
It seems broadcasts don't flow from laptop to VE400 (tcpdump inside VE400 don't detect any broadcast from laptop, although it detects all the other packets arriving from it).
I tried to change /proc/sys/net/ipv4/conf/br0/bootp_relay and /proc/sys/net/ipv4/conf/eth2/bootp_relay to 1, but nothing happened too (it seems this bootp_relay doesn't work either).

I don't know what else to do now.
Is there anyone who knows the answer?

Thanks,


M.Carreira

[Updated on: Tue, 27 March 2007 08:32] by Moderator

Report message to a moderator

Re: Trying to get IP in a laptop from a DHCP server inside a VE. [message #11518 is a reply to message #11491] Mon, 26 March 2007 09:46 Go to previous messageGo to next message
Andrey Mirkin is currently offline  Andrey Mirkin
Messages: 193
Registered: May 2006
Senior Member
Please post here output of following commands.
In VE0
ip a l
ip r l
brctl show

In VE:
ip a l
ip r l



Andrey Mirkin
http://static.openvz.org/userbars/openvz-developer.png
Re: Trying to get IP in a laptop from a DHCP server inside a VE. [message #11524 is a reply to message #11518] Mon, 26 March 2007 12:16 Go to previous messageGo to next message
mcarreira is currently offline  mcarreira
Messages: 30
Registered: February 2007
Member
Here it is:


In VE0:
------

[root@vzrouter ~]# ip a ls
2: lo: <LOOPBACK,UP,10000> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
4: sit0: <NOARP> mtu 1480 qdisc noop
link/sit 0.0.0.0 brd 0.0.0.0
6: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:0e:2e:83:e3:99 brd ff:ff:ff:ff:ff:ff
inet 10.17.30.254/24 brd 10.17.30.255 scope global eth0
8: eth1: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:18:f3:6c:4a:33 brd ff:ff:ff:ff:ff:ff
inet 192.168.10.55/24 brd 192.168.10.255 scope global eth1
inet6 fe80::218:f3ff:fe6c:4a33/64 scope link
valid_lft forever preferred_lft forever
10: eth2: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:18:f3:6c:4b:44 brd ff:ff:ff:ff:ff:ff
inet 192.168.30.254/24 brd 192.168.30.255 scope global eth2
inet6 fe80::218:f3ff:fe6c:4b44/64 scope link
valid_lft forever preferred_lft forever
1: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,10000> mtu 1500 qdisc noqueue
link/void
3: veth400.0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc noqueue
link/ether 00:18:51:06:11:78 brd ff:ff:ff:ff:ff:ff
inet6 fe80::218:51ff:fe06:1178/64 scope link
valid_lft forever preferred_lft forever
12: br0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc noqueue
link/ether 00:18:51:06:11:78 brd ff:ff:ff:ff:ff:ff
inet6 fe80::218:51ff:fe06:1178/64 scope link
valid_lft forever preferred_lft forever




[root@vzrouter ~]# ip r l
192.168.30.22 dev venet0 scope link
192.168.30.53 dev br0 scope link
10.17.30.0/24 dev eth0 proto kernel scope link src 10.17.30.254
192.168.30.0/24 dev eth2 proto kernel scope link src 192.168.30.254
192.168.10.0/24 dev eth1 proto kernel scope link src 192.168.10.55
default via 192.168.10.1 dev eth1



[root@vzrouter ~]# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.001851061178 no veth400.0



--------------------

In VE400:
---------

[root@sdns ~]# ip a l
1: lo: <LOOPBACK,UP,10000> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
3: venet0: <BROADCAST,POINTOPOINT,NOARP> mtu 1500 qdisc noop
link/void
5: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc noqueue
link/ether 00:18:51:d2:4e:66 brd ff:ff:ff:ff:ff:ff
inet 192.168.30.53/24 brd 192.168.30.255 scope global eth0
inet6 fe80::218:51ff:fed2:4e66/64 scope link
valid_lft forever preferred_lft forever


[root@sdns ~]# ip r l
192.168.30.0/24 dev eth0 proto kernel scope link src 192.168.30.53
default via 192.168.30.254 dev eth0



Re: Trying to get IP in a laptop from a DHCP server inside a VE. [message #11528 is a reply to message #11524] Mon, 26 March 2007 14:06 Go to previous messageGo to next message
Andrey Mirkin is currently offline  Andrey Mirkin
Messages: 193
Registered: May 2006
Senior Member
You need to add to bridge eth2 interface too.
And move IP configuration (IP address and routes) from eth2 interface to br0 device.
I would suggest to not perform IP changes from remote console, because connection will be lost when you will remove IP address from eth2 device.

It is needed to add eth2 interface to bridge too, because only in this case packets from 192.168.30.0/24 network will be delivered to VE 400 without routing and hence DHCP packets will not dropped.


Andrey Mirkin
http://static.openvz.org/userbars/openvz-developer.png
icon14.gif  Re: Trying to get IP in a laptop from a DHCP server inside a VE. [message #11554 is a reply to message #11528] Tue, 27 March 2007 00:08 Go to previous message
mcarreira is currently offline  mcarreira
Messages: 30
Registered: February 2007
Member
Thanks a lot for your help!
It's working now!
Previous Topic: Need help in understanding example resource config
Next Topic: Problems with NFS?
Goto Forum:
  


Current Time: Wed Aug 14 02:23:53 GMT 2024

Total time taken to generate the page: 0.02829 seconds