LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   routing over virtual interface (https://www.linuxquestions.org/questions/linux-server-73/routing-over-virtual-interface-706723/)

noir911 02-22-2009 10:50 PM

routing over virtual interface
 
I have a virtual linux box sitting on a ESX server. I would like to setup a virtual interface on that box (eth0:0) and assign an IP address: 192.169.25.1 - that's the easy part.

The hard part: if anything comes to that IP address, I would like to redirect it to a particular subnet (basically, making it a router) - does anyone know how to achieve that?

Thanks.

gergely89 02-23-2009 10:47 AM

If the main purpose of that virtual linux box is to serve as a router, then rather install a router like Smoothwall, which is actually a dedicated Linux system with modest system requirements acting as a router. Have a look at http://www.smoothwall.org/ for more info on this.

The other solution would be to add some forwarding and masquerading commands to your firewall.
Something like this maybe
Quote:

iptables -t nat -A PREROUTING -p tcp -i eth0 -d Y.Y.Y.Y --dport 80 -j DNAT --to Z.Z.Z.Z:80
iptables -A FORWARD -p tcp -i eth0 -d Z.Z.Z.Z --dport 80 -j ACCEPT
There has been a thread on linuxquestions.org lately about port forwarding - browse or Google for it.

linux


All times are GMT -5. The time now is 06:55 AM.