This one works for me: iptables -t nat -A OUTPUT -p tcp -d 127.0.0.1 --dport 81 \ -j REDIRECT --to-ports 80 Alex Cópia Henry Ritzlmayr <h.ritzlmayr@xxxxxx>: > Am Don, 2003-03-20 um 16.29 schrieb Rob Sterenborg: > > > And here is the question. How is it possible to nat a lokal port? > > > > > > IPTABLES -t nat -A PREROUTING -p tcp -d 127.0.0.1 > > > --destination-port 81 -j DNAT --to-destination 127.0.0.1:80 > > > > > > telnet localhost 80 <<< works > > > telnet localhost 81 <<< Connection refused > > > > iptables -t nat -A PREROUTING -d 127.0.0.1 -p tcp --dport 80 -j > REDIRECT > > --to-ports 81 > > > > > > Rob > > Tanks for the answer, > I tried that one already but it behaves the same. > I also tried > > IPTABLES -t nat -A PREROUTING -p tcp -d 172.16.172.12 > --destination-port > 81 -j REDIRECT --to-ports 80 > > wich works perfect for both port 80 and 81 from a foreign host. > > Henry > >