iptables --sport doesn't seem to work with REDIRECT

iptables --sport doesn't seem to work with REDIRECT

Post by jorge.ho.. » Thu, 11 Oct 2007 07:26:04

   iptables -t nat -A PREROUTING -p tcp --sport 6666 --dport 2222 -j
REDIRECT --to-ports 22

I would expect this to redirect only the packets with the source port
being 6666 but instead any packet with 2222 as destination port is
redirected. Does it ignore --sport?


1. Port Redirect works but doesn't redirect internal traffic

I have two FBSD-4.6 servers. Machine 'A' connects to the internet via 56K
modem and runs NATD for internal unregistered Class 'C' network. Machine 'B'
is on this internal network and runs Apache web server. Machine 'A'
redirects traffic for port 80 to machine 'B'. This works great. So far so

When I try to access the webserver from a Windows workstation on the
internal network, I cannot get to it. Outside traffic from the internet gets
directed just fine, but nothing internal can access the web server.

Here are my setup files:

natd_flags="-f /etc/natd.conf"

redirect_port udp 80
redirect_port tcp 80

Is it possible that I need to add my NIC ed0 to the natd_interface setting
in the /etc/rc.conf file? Is it possible to have both devices as a NATD

2. Q: Installing RedHat on WinNT box?

3. squidguard doesn't seem redirect

4. How to detect CPU type??

5. squidguard doesn't seem redirect - freebsd

6. Question on Proc

7. sed -e s/\'/\&apos\;/g doesn't seem to work

8. AOL & ftp daemon hanging.

9. slackware-elf-beta's emacs doesn't seem to be working..

10. qt2.2.1 doesn't seem to work with Nvidia's openGL library

11. IPTables vs. DNS (or : iptables doesn't change sourceport when MASQ'ing)

12. Re. bffcreate -X doesn't work Re: bffcreate -X Doesn't Work

13. Linux on iBook: RTC doesn't seem to work