OpenVZ Forum


Home » General » Support » *SOLVED* multiples interfaces ?
*SOLVED* multiples interfaces ? [message #5853] Fri, 01 September 2006 14:21 Go to next message
pollux is currently offline  pollux
Messages: 13
Registered: September 2006
Junior Member
I have a host system with 2 interfaces, one with a public address (eth0) and a private address (eth1)
I have added 2 ip addresses using vzctl to the VPS, one in each network:
vzctl set 108 --ipadd 134.214.51.158 --save
vzctl set 108 --ipadd 10.0.0.108 --save


Seems ok, but from the VPS I am unable to access hosts in the private network:
webmail:~# ping 10.0.0.12
PING 10.0.0.12 (10.0.0.12) 56(84) bytes of data.
--- 10.0.0.12 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 999ms


The same ping from the host works. The routing table from host seems ok:
vz:~# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.0.0.108      0.0.0.0         255.255.255.255 UH        0 0          0 venet0
134.214.51.157  0.0.0.0         255.255.255.255 UH        0 0          0 venet0
134.214.51.158  0.0.0.0         255.255.255.255 UH        0 0          0 venet0
10.0.0.0        0.0.0.0         255.255.255.0   U         0 0          0 eth1
134.214.50.0    0.0.0.0         255.255.254.0   U         0 0          0 eth0
0.0.0.0         134.214.50.1    0.0.0.0         UG        0 0          0 eth0


Does someone else have this problem ? Or do I miss any configuration ?

Thanks

[Updated on: Fri, 08 September 2006 06:43] by Moderator

Report message to a moderator

Re: multiples interfaces ? [message #5857 is a reply to message #5853] Fri, 01 September 2006 15:24 Go to previous messageGo to next message
Andrey Mirkin is currently offline  Andrey Mirkin
Messages: 193
Registered: May 2006
Senior Member
Can you please post here tcpdump output on host-node for eth1 and venet0 interfaces when you pinging 10.0.0.12 host from VPS, i.e.:
[host-node]# tcpdump -i eth1 host 10.0.0.12
and
[host-node]# tcpdump -i venet0 host 10.0.0.12

when
[vps]# ping 10.0.0.12



Please also try to ping host 10.0.0.12 in following way:
[vps]# ping 10.0.0.12 -I 10.0.0.108


Andrey Mirkin
http://static.openvz.org/userbars/openvz-developer.png
Re: multiples interfaces ? [message #5859 is a reply to message #5857] Fri, 01 September 2006 15:42 Go to previous messageGo to next message
pollux is currently offline  pollux
Messages: 13
Registered: September 2006
Junior Member
Here you are:

host# tcpdump -i eth1 -n host 10.0.0.12
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes
17:37:19.184178 IP 134.214.51.158 > 10.0.0.12: ICMP echo request, id 53255, seq 1, length 64
17:37:20.184319 IP 134.214.51.158 > 10.0.0.12: ICMP echo request, id 53255, seq 2, length 64
17:37:21.184164 IP 134.214.51.158 > 10.0.0.12: ICMP echo request, id 53255, seq 3, length 64

3 packets captured
6 packets received by filter
0 packets dropped by kernel


Note that the source address is clearly wrong (should have been 10.0.0.108)

host# tcpdump -i venet0 -n host 10.0.0.12
tcpdump: WARNING: arptype 65535 not supported by libpcap - falling back to cooked socket
tcpdump: WARNING: venet0: no IPv4 address assigned
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on venet0, link-type LINUX_SLL (Linux cooked), capture size 96 bytes
17:38:23.179430 IP 134.214.51.158 > 10.0.0.12: ICMP echo request, id 53255, seq 65, length 64
17:38:24.179289 IP 134.214.51.158 > 10.0.0.12: ICMP echo request, id 53255, seq 66, length 64
17:38:25.179117 IP 134.214.51.158 > 10.0.0.12: ICMP echo request, id 53255, seq 67, length 64
17:38:26.179034 IP 134.214.51.158 > 10.0.0.12: ICMP echo request, id 53255, seq 68, length 64

4 packets captured
8 packets received by filter
0 packets dropped by kernel


Same comment.

And finally:
vps# ping 10.0.0.12 -I 10.0.0.108
PING 10.0.0.12 (10.0.0.12) from 10.0.0.108 : 56(84) bytes of data.
64 bytes from 10.0.0.12: icmp_seq=1 ttl=63 time=0.102 ms
64 bytes from 10.0.0.12: icmp_seq=2 ttl=63 time=0.099 ms


So it's working when specifying the source address. Is there any way to make this working without arguments ? (maybe using source routing ?)

Thanks for your help
Re: multiples interfaces ? [message #5860 is a reply to message #5859] Fri, 01 September 2006 16:02 Go to previous messageGo to next message
Andrey Mirkin is currently offline  Andrey Mirkin
Messages: 193
Registered: May 2006
Senior Member
You can see http://wiki.openvz.org/Source_based_routing for details.

Or you can use veth devices if you use 2.6.16 ovz kernel. With veth devices you can easily solve this problem.


Andrey Mirkin
http://static.openvz.org/userbars/openvz-developer.png
Re: multiples interfaces ? [message #5862 is a reply to message #5860] Fri, 01 September 2006 16:10 Go to previous messageGo to next message
pollux is currently offline  pollux
Messages: 13
Registered: September 2006
Junior Member
Yes, except that I fail to see how source routing would help setting the source address (but I'm not very familiar with it). Is it really possible using routing ?

I'd appreciate some help on this point.
Re: multiples interfaces ? [message #5900 is a reply to message #5862] Tue, 05 September 2006 09:27 Go to previous messageGo to next message
Andrey Mirkin is currently offline  Andrey Mirkin
Messages: 193
Registered: May 2006
Senior Member
Do you have problems with another programs?
Ping use by default first IP address, that is why you can't ping 10.0.0.12 by default. But if tcp packet will has correct source IP, then everything will work fine. Just configure applications you want use (httpd, smb, etc.) correctly.


Andrey Mirkin
http://static.openvz.org/userbars/openvz-developer.png
Re: multiples interfaces ? [message #5901 is a reply to message #5862] Tue, 05 September 2006 09:35 Go to previous messageGo to next message
pollux is currently offline  pollux
Messages: 13
Registered: September 2006
Junior Member
Yes, TCP connections have the same problem:
vz:~# man telnet
Reformatting telnet(1), please wait...
vz:~# telnet 10.0.0.12 110
Trying 10.0.0.12...

vz:~# telnet -b 10.0.0.108 10.0.0.12 110
Trying 10.0.0.12...
Connected to 10.0.0.12.
Escape character is '^]'.
+OK Hello there.


Thanks for your help.
Re: multiples interfaces ? [message #5904 is a reply to message #5901] Tue, 05 September 2006 11:00 Go to previous messageGo to next message
Andrey Mirkin is currently offline  Andrey Mirkin
Messages: 193
Registered: May 2006
Senior Member
Did you try to make veth network configuration?
See http://wiki.openvz.org/Virtual_Ethernet_device for details.
With two virtual ethernet adapters you will not need to specify source IP address in applications.


Andrey Mirkin
http://static.openvz.org/userbars/openvz-developer.png
Re: multiples interfaces ? [message #6050 is a reply to message #5904] Thu, 07 September 2006 09:49 Go to previous message
pollux is currently offline  pollux
Messages: 13
Registered: September 2006
Junior Member
Yes, I know I could have used a veth to do that. I was trying to avoid this solution because the docs mention some problems with that .. (and that it should also work with venet, veth is only a workaround Wink )

Anyway, I have found:
vz# ip route add 10.0.0.0/24 dev venet0 src 10.0.0.108


Thanks for you help.
Previous Topic: *SOLVED* Hardware Drivers
Next Topic: IPV6 Support in VPS
Goto Forum:
  


Current Time: Fri Aug 23 06:16:51 GMT 2024

Total time taken to generate the page: 0.03210 seconds