Re: Forcing a particular IP address out to an interface

nick4soup_at_yahoo.com.au
Date: 10/13/05

  • Next message: GS: "Every time my Linux PC gets new Ip address, I can't access remotely, how can I access?/"
    Date: 12 Oct 2005 15:44:08 -0700
    
    

    Floyd L. Davidson wrote:

    > It never gets anywhere near the route table though. If the IP
    > address is assigned to an interface on the host, it goes to the
    > lo device regardless of what is in the route table.

    As they would say in New Zealand, BUGGER.

    Next approach: pretend that the ppp0 interface on the 'left' box has IP
    addresses:
       192.168.3.xx, and use iptables to mangle the destination address of
    the packet somewhere along its route.

      1. Therefore on left, I ping 192.168.3.23.
      2. It will route out to 'right', via eth0
      3. when right receives the packet, it will forward to the ppp0
    connection, courtesy of its default route (we also have masquerading
    here, changes source addr to 192.168.1.10)
      4. in 'left', I will have to use iptables to mangle the incoming
    packet to alter the destination address to 192.168.1.23

    It requires I use something like (please excuse syntax):
      iptables -t nat -A PREROUTING -i ppp+ --dst 192.168.3.23 -j DNAT
    --todestination-addr 192.168.1.23

    I already tried mangling the outgoing packet on left using
      iptables -t nat -A OUTPUT --dst 192.168.3.23 -j DNAT
    --todestination-addr 192.168.1.23
    but I ran into the same razor.

    Nick Bishop, email replies ignored.
    -----
    Position vacant: suicide bomber.
    Previous experience essential.
    -oOo-


  • Next message: GS: "Every time my Linux PC gets new Ip address, I can't access remotely, how can I access?/"

    Relevant Pages

    • Re: dialup solution (as seconary connection / iptables )
      ... with no default route for the PPP interface if you want to ... ethx is the host's Ethernet interface. ... it's the dialup host. ... In both instances the packet should be sent, ...
      (comp.os.linux.networking)
    • Re: Q: multi-homed server with multiple default routers
      ... Instead only the destination address and routing table are used ... to determine the interface and hardware destination. ... A "default" router is one used when no other router matches.. ... Install IP filter and have it route based on packet content. ...
      (comp.unix.solaris)
    • Re: sent an invalid ICMP type 11, code 0 error to a broadcast: 0.0.0.0 on lo?
      ... > If you ping an IP address on your computer, ... > the lo route filtering altogether. ... ICMP packet, with source address on this same box. ... IF that packet comes from the interface where the default ...
      (Linux-Kernel)
    • Re: site to site vpn with internal NAT
      ... :interface. ... :192.168.1.101 tries to contact a peer on the remote side, ... so the *destination* IP 192.168.49.x will be changed to the destination ... and since there is a match, the packet will go out over the VPN. ...
      (comp.dcom.sys.cisco)
    • Re: how to interpret route command
      ... network interface configuration for *receiving* data packets. ... It deals with the IP addresses for network interfaces, ... So when we look at a route table, do not expect to see anything ... necessary to decide on a per packet basis which network gets ...
      (comp.os.linux.networking)