Routing - Forward all traffic to an ip to another ip

Discussion in 'Installation/Configuration' started by bsgcic, Jul 25, 2010.

  1. bsgcic

    bsgcic New Member

    I need to be able to do the following:

    Physical Router located at

    On Ubuntu 10.04 Lucid machine:
    eth0 with static ip
    eth1 with static ip
    eth2 with static ip

    Associate a virtual address to eth1 with an entirely different network address such as
    Do the same (virtual address) for eth2 -- e.g.

    In the application:
    register phone number A at (The application will automatically use eth0 for this)
    register phone number B at
    register phone number C at

    Somehow forward all traffic (including the register request) sent to to as if the register had been made directly to In other words, the app "sends" registration and traffic to but then Ubuntu forwards it to (but the app does not know that).

    Similarly, forward all traffic sent to to the router at

    Do the same for the reverse, forward all traffic that the router sends back to (eth1) to (within the Ubuntu machine) so that the app knows it is for phone B.
    Similarly forward all traffic that the router sends back to (eth2) to so that the app knows it is for phone C.

    Thus, the application believes that it is registering at 3 completely separate routers on 3 completely separate networks via 3 separate network interfaces but in fact is really registering all three to the same router (but does not know that).

    Similarly, the router believes that it is receiving 3 separate registrations because it receives each registration request and traffic from 3 separate interfaces and thus 3 separate mac addresses (i.e., of eth0, eth1, and eth2).

    Traffic sent to and from the router for each of the 3 phone numbers (via eth0, eth1, and eth2) are not mixed because the translation happens in both directions.

    I have been searching via google, looking into iptables, brctl, ipfwadm, etc and am lost.
    Your help would be greatly appreciated.


Share This Page