OpenVZ Forum


Home » General » Support » *SOLVED* 2 subnet in an VPS
icon9.gif  *SOLVED* 2 subnet in an VPS [message #11909] Wed, 11 April 2007 14:07 Go to next message
kangoo is currently offline  kangoo
Messages: 3
Registered: April 2007
Location: Belgium
Junior Member

Hello

I have two NIC on my physical host(both of theme are separated on a different physical network (two different switch)), and i'm trying to have a private and a public network. So i have dedicated 2 IP address to my VPS :

192.168.150.219
192.168.2.2

When i want to ping my notebook (192.168.2.1) that is in the 192.168.2 network it does not respond, but if i ping my VPS (192.168.2.2) from my notebook it works, thus i have noticed one thing, i captured the packet traveling on the network 192.168.2 and noticed that the packets gets to my notebook but my notebook does not respond, why??? well simply because the respond address is 192.168.150.219. that means that the respond address placed in the packet when send from the VPS is the first address that was set to the VPS. If i had put the 192.168.2.2 address first it would of worked. It is the address listed when you do a vzlist -a

Is there any way that when you ping a network the virtual interface puts the right response address. if i ping 192.168.2.1 the response address would be 192.168.2.2 and if i ping 192.168.150.52 the response address would be 192.168.150.219

[Updated on: Wed, 18 April 2007 06:15] by Moderator

Report message to a moderator

Re: 2 subnet in an VPS [message #11942 is a reply to message #11909] Thu, 12 April 2007 11:11 Go to previous messageGo to next message
Andrey Mirkin is currently offline  Andrey Mirkin
Messages: 193
Registered: May 2006
Senior Member
Hello,

Following command should work:
# ping 192.168.2.1 -I 192.168.2.2

Also, please take a look on:
http://wiki.openvz.org/Source_based_routing


Andrey Mirkin
http://static.openvz.org/userbars/openvz-developer.png
Re: 2 subnet in an VPS [message #11946 is a reply to message #11942] Thu, 12 April 2007 12:04 Go to previous messageGo to next message
kangoo is currently offline  kangoo
Messages: 3
Registered: April 2007
Location: Belgium
Junior Member

yes but that was for testing

what interests me is that any program can be able to access the outside world and get a reply on the right address
Re: 2 subnet in an VPS [message #11973 is a reply to message #11946] Fri, 13 April 2007 10:11 Go to previous messageGo to next message
Andrey Mirkin is currently offline  Andrey Mirkin
Messages: 193
Registered: May 2006
Senior Member
Well, you just need to configure your applications to use correct IP address, in this case all packets will have correct source IP address.

Andrey Mirkin
http://static.openvz.org/userbars/openvz-developer.png
Re: 2 subnet in an VPS [message #12031 is a reply to message #11973] Mon, 16 April 2007 06:55 Go to previous message
kangoo is currently offline  kangoo
Messages: 3
Registered: April 2007
Location: Belgium
Junior Member

thanks for your answer

Cool Very Happy
Previous Topic: *SOLVED* Firewall tutorial
Next Topic: VPS&cPanel: High processor load
Goto Forum:
  


Current Time: Tue Apr 30 22:57:16 GMT 2024

Total time taken to generate the page: 0.01791 seconds