[wellylug] Router/Firewall

Michael Bordignon michael.b at infometrics.co.nz
Wed Jan 21 17:04:03 NZDT 2004


> I need to set up a simple Router/Firewall between two 
> networks here at work. I'm thinking a simple Linux box 
> (either Debian or Gentoo) then just the appropriate 
> ipchains/iptales commands to send the material between the 
> networks. The only thing that is eluding me is how to get 
> iptables to forward the specific port between networks, and 
> only that port. The port is 5902 and lets assume that the 
> networks are 1.2.3.0 and 6.7.8.0 - can someone help me out 
> with the appropriate iptables/ipchains commands... as I'm at 
> a loss on this one! (I think that with Debian ipchains is my 
> only option? And I can't seem to get the Kernel to support 
> either in Gentoo at the moment!!!).

## Change destination addresses of web traffic to 5.6.7.8, port 8080.
# iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth0 \
        -j DNAT --to 5.6.7.8:8080

http://www.netfilter.org/documentation/HOWTO//NAT-HOWTO-6.html#ss6.1



More information about the wellylug mailing list