IP tables help

IP tables help

Post by CCW » Sun, 18 May 2008 20:59:44


I'm having problems with my Samba / internet connectivity.  I have the
following setup:

Router ( --- eth0 ( - eth1 ( ---
Windows workgroup (

Once I'd set IP addresses on the Windows PCs (I'm using static IP
addresses), using the default FC7 IPtables setup, the Windows PCs
could see the internet, but not see the Samba share I'd created.
Adding 2 rules to the IPtables manually, on the command line:

-I INPUT -i eth1 -p UDP -m multiport --dports 137, 138, 631 -j ACCEPT
-I INPUT -i eth1 -p TCP -m multiport --dports 135, 139, 445, 631 -j

solved this problem.  However, adding the following lines to /etc/
sysconfig/iptables file:

-A RH-Firewall-1-INPUT -p udp -m udp --dport 137 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 138 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 139
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 445

I've attempted various combinations of adding port 631 to the rules
file but nothing seem to work.  If anyone can help me with what the
correct rules should be, I'd be most grateful.



1. IP tables help to forward news server login


My ISP does not allow remote access to their news server.  I was thinking
that I could create a iptables rule that would forward and masq any
requests from my workstation at work on port 119 to my ISP's news server at
port 119

Masquerading is not something I've figured out yet.  I thought about:

ipables -A FORWARD -s <my work ip> --sport 119 -d <my server ip> --dport
119 -j ???

Assuming that's close.  How do now tell iptables to forward, using NAT, to
my IPS?

Neil Watson

2. Virtual Host + Devices - Please Help

3. ip tables vpn pptp and ip gre47

4. Linux install problem!

5. IP Chains / Ip Tables

6. RHLinux 4.2 on SPARC IPX

7. IP tables script, multiple IP's ?

8. make lost-tick detection more informative

9. IP Tables & IP Accounting

10. Going from IP chains to IP tables

11. Cannot FTP via IP MASQUERADE with IP tables

12. IP Tables v. IP Chains

13. how to do ip spoofing with ip tables..