*SOLVED* Connect VE to two different networks on two different NIC's [message #12274] |
Mon, 23 April 2007 20:46 |
abachn
Messages: 6 Registered: April 2007
|
Junior Member |
|
|
Hi
I'm a bit new to openvz, but I have a (actually two) machines running openvz kernel 2.6.18 -028.027 kernel on a gentoo base system!
The machine has two NIC's. One connected to an internal net with private ip's and one connected to an external net with public ip's.
My question is now, is it possible for a VE to have two ip addresses, one on each network ?
Its default gateway is on the external net, the internal net is only for accessing services that are not public!
If, it is possible! How should the be done!
I hope somebody will through me a bone and give me some directions on how to do this. Thank you!
/Anders
[Updated on: Fri, 11 May 2007 07:54] by Moderator Report message to a moderator
|
|
|
|
Re: Connect VE to two different networks on two different NIC's [message #12749 is a reply to message #12283] |
Tue, 08 May 2007 17:07 |
abachn
Messages: 6 Registered: April 2007
|
Junior Member |
|
|
Thank you for your answer and it works ... kind of!!
The situation is as follows! I have these servers..
(HN1) Hardware node 1: non-openvz hosts, both a public and private ip
(HN2) Hardware node 2: openvz-hosts, running several VE instances, both public and private ip
VE 1: minimal host with public and private ip
VE 2: minimal host with public and private ip
The problem is now that I can't ping HN1 from a VE on the private class A network!
I can ping
HN2 -> HN1
HN1 -> HN2
HN2 -> VE1
VE1 -> HN2
VE1 -> VE2
but not!!!
VE1 -> HN1
On the private network ... I can ping from VE1 -> HN1 on the public network....
I have not done any routing setup on HN2 (chloe)
chloe ~ # ip a l
2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:12:79:39:3f:b9 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.151/24 brd 10.0.0.255 scope global eth0
4: eth1: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:12:79:39:4f:11 brd ff:ff:ff:ff:ff:ff
inet 217.195.176.151/24 brd 217.195.176.255 scope global eth1
6: 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 brd 127.255.255.255 scope host lo
8: tunl0: <NOARP> mtu 1480 qdisc noop
link/ipip 0.0.0.0 brd 0.0.0.0
10: gre0: <NOARP> mtu 1476 qdisc noop
link/gre 0.0.0.0 brd 0.0.0.0
1: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,10000> mtu 1500 qdisc noqueue
link/void
chloe ~ # ip r l
217.195.176.140 dev venet0 scope link
10.0.0.161 dev venet0 scope link
217.195.176.141 dev venet0 scope link
217.195.176.142 dev venet0 scope link
217.195.176.139 dev venet0 scope link
10.0.0.141 dev venet0 scope link
217.195.176.161 dev venet0 scope link
10.0.0.140 dev venet0 scope link
217.195.176.0/24 dev eth1 proto kernel scope link src 217.195.176.151
10.0.0.0/24 dev eth0 proto kernel scope link src 10.0.0.151
127.0.0.0/8 dev lo scope link
default via 217.195.176.1 dev eth1
What am I missing to route trafik from VE* -> HN1 ... a physical host on the private network!!
I hope you can help!!
|
|
|
|
Re: Connect VE to two different networks on two different NIC's [message #12766 is a reply to message #12754] |
Wed, 09 May 2007 07:03 |
abachn
Messages: 6 Registered: April 2007
|
Junior Member |
|
|
HN1 (non openvz system, names christa)
christa ~ # ip a l
1: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:0b:cd:29:41:fb brd ff:ff:ff:ff:ff:ff
inet 10.0.0.154/24 brd 10.0.0.255 scope global eth0
inet6 fe80::20b:cdff:fe29:41fb/64 scope link
valid_lft forever preferred_lft forever
2: eth1: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:0b:cd:29:41:fa brd ff:ff:ff:ff:ff:ff
inet 217.195.176.154/24 brd 217.195.176.255 scope global eth1
inet6 fe80::20b:cdff:fe29:41fa/64 scope link
valid_lft forever preferred_lft forever
3: 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 brd 127.255.255.255 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
christa ~ # ip r l
217.195.176.0/24 dev eth1 proto kernel scope link src 217.195.176.154
10.0.0.0/24 dev eth0 proto kernel scope link src 10.0.0.154
127.0.0.0/8 dev lo scope link
default via 217.195.176.1 dev eth1
I can ping all other combinations of hosts but not on the private class A network from VE1 (citha) to HN1 (christa)
Here are the information on citha!
citha / # ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 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 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:217.195.176.141 P-t-P:217.195.176.141 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:17740 errors:0 dropped:0 overruns:0 frame:0
TX packets:17899 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1692354 (1.6 Mb) TX bytes:2990896 (2.8 Mb)
venet0:1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.0.0.141 P-t-P:10.0.0.141 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:17740 errors:0 dropped:0 overruns:0 frame:0
TX packets:17899 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1692354 (1.6 Mb) TX bytes:2990896 (2.8 Mb)
citha / # 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
3: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,10000> mtu 1500 qdisc noqueue
link/void
inet 217.195.176.141/32 scope global venet0
inet 10.0.0.141/32 scope global venet0:1
citha / # ip r l
192.0.2.0/24 dev venet0 scope link
127.0.0.0/8 via 127.0.0.1 dev lo scope link
default via 192.0.2.1 dev venet0
|
|
|
|
|
|
|