Translating between local and global IP address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

My home network is set up something like this:

                    internet
                       |
                      eth0
                  GATEWAY (Linux)
                      eth1
                       |
                 COMPUTER (Windows)

COMPUTER has a local IP address ($IN), but I'd like to mangle packets
going through GATEWAY so COMPUTER appears to have another IP address
($OUT) on the internet.  It seems I've had some success with this:

  iptables -t nat -A POSTROUTING -o eth0 -s $IN  -j SNAT --to-source $OUT
  iptables -t nat -A PREROUTING  -i eth0 -d $OUT -j DNAT --to-destination $IN

And to fool GATEWAY into accepting packets for $OUT, I've done this:

  ifconfig eth0:1 $OUT

However, it doesn't seem to work when trying to play a network game on
COMPUTER.  It times out trying to connect to another machine on the
internet.  It probably uses UDP packets.

Any idea what I'm doing wrong?

Thanks.


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux