Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 02-22-2009, 10:50 PM   #1
Registered: Apr 2004
Posts: 682

Rep: Reputation: Disabled
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: - 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?

Old 02-23-2009, 10:47 AM   #2
Registered: Feb 2009
Posts: 100

Rep: Reputation: 21
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 for more info on this.

The other solution would be to add some forwarding and masquerading commands to your firewall.
Something like this maybe
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 lately about port forwarding - browse or Google for it.


Last edited by gergely89; 02-27-2009 at 10:50 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create routing between virtual interface in linux attojung Linux - Networking 2 03-13-2009 01:06 PM
virtual interface routing noir911 Linux - Server 11 10-22-2008 06:11 PM
Adding virtual interface for IP based virtual host pridefc Linux - General 6 03-16-2008 03:52 PM
Routing on a single Interface bernard7 Linux - Networking 2 05-01-2006 04:06 PM
interface ok, dhcp ok, routing gw not ok- help sokar Linux - Wireless Networking 4 02-04-2004 10:39 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:10 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration