LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-30-2005, 10:57 PM   #1
phipi
LQ Newbie
 
Registered: Nov 2005
Posts: 1

Rep: Reputation: 0
Iptables Roach Motel: Stuff gets in, can't get out.


I've got an iptables firewall set up on my Linux box, which serves as a gateway to the internet. The internet side is eth1, with a DHCP address in the range 66.235.0.0/16. The local network side is eth0, with a static address of 192.168.0.4. I'm running a server on the local network at 192.168.0.6:8333 that I want to make available to the internet. To test the server from the outside, I've set up a CGI-based reflector on an outside server that initiates requests and forwards responses back to my browser. I've done this before, so I know this part works reliably. What's happening is that the outside requests are getting through and logging on the local server, but the server's responses are not making it back out to the requestor. Here's a dump of my iptables:


***NAT***

Chain PREROUTING (policy ACCEPT 951 packets, 77717 bytes)
pkts bytes target prot opt in out source destination
2 120 DNAT tcp -- eth1 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:8333 to:192.168.0.6:8333

Chain POSTROUTING (policy ACCEPT 66 packets, 8576 bytes)
pkts bytes target prot opt in out source destination
296 22030 MASQUERADE all -- * eth1 0.0.0.0/0 0.0.0.0/0

Chain OUTPUT (policy ACCEPT 252 packets, 24084 bytes)
pkts bytes target prot opt in out source destination

***FILTER***

Chain INPUT (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT tcp -- eth1 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:9090 flags:0x16/0x02
15616 2925K FIREWALL all -- * * 0.0.0.0/0 0.0.0.0/0

Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT tcp -- eth1 eth0 0.0.0.0/0 0.0.0.0/0 tcp dpt:8333
923 209K ACCEPT all -- eth0 eth1 0.0.0.0/0 0.0.0.0/0
1030 560K FIREWALL all -- * * 0.0.0.0/0 0.0.0.0/0

Chain OUTPUT (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
16309 3742K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0

Chain FIREWALL (2 references)
pkts bytes target prot opt in out source destination
9583 1874K ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
5203 757K ACCEPT all -- eth0 * 0.0.0.0/0 0.0.0.0/0
0 0 DROP all -- eth1 * 192.168.0.0/24 0.0.0.0/0
46 9566 ACCEPT udp -- eth1 * 66.235.59.6 0.0.0.0/0 udp spt:53
7 1732 ACCEPT udp -- eth1 * 66.235.59.7 0.0.0.0/0 udp spt:53
0 0 ACCEPT udp -- eth1 * 66.235.63.2 0.0.0.0/0 udp spt:53
0 0 ACCEPT udp -- eth1 * 66.235.63.4 0.0.0.0/0 udp spt:53
1 76 ACCEPT udp -- eth1 * 0.0.0.0/0 0.0.0.0/0 udp spt:123
144 35956 DROP udp -- * * 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT tcp -- eth0 * 192.168.0.0/24 0.0.0.0/0 tcp flags:0x16/0x02
0 0 ACCEPT tcp -- lo * 192.168.0.0/24 0.0.0.0/0 tcp flags:0x16/0x02
0 0 DROP tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x16/0x02
1662 807K ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 icmp type 0
0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 icmp type 3
0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 icmp type 4
0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 icmp type 11
0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 icmp type 12
0 0 DROP icmp -- * * 0.0.0.0/0 0.0.0.0/0


Perhaps someone more experienced than I am can see where I've blundered.

Thanks,
Phil
 
Old 12-01-2005, 06:24 PM   #2
ToeShot
Member
 
Registered: Nov 2001
Location: Near Chicago
Distribution: FC5, Solaris 10, WinXP
Posts: 152

Rep: Reputation: 30
You might try and look here

http://iptables-tutorial.frozentux.n...-tutorial.html
 
Old 12-01-2005, 08:02 PM   #3
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
Can you post your actually iptables script, it maybe a bit easier to see how it's setup
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
internet access motel doorman007 Linux - Software 1 11-23-2005 04:45 AM
When installing new stuff in suse 9.1, do you uninstall old stuff first? randon SUSE / openSUSE 1 12-25-2004 04:37 PM
Iptables - Couldn't load target `ACCPET':/lib/iptables/libipt_ACCPET.so: z00t Linux - Security 3 01-26-2004 02:24 AM
IPtables Log Analyzer from http://www.gege.org/iptables/ brainlego Linux - Software 0 08-11-2003 06:08 AM
My iptables script is /etc/sysconfig/iptables. How do i make this baby execute on boo ForumKid Linux - General 3 01-22-2002 07:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration