LinuxQuestions.org
Register a domain and help support LQ
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 02-02-2006, 03:04 AM   #1
gugabaga
Member
 
Registered: Jan 2006
Distribution: Fedora
Posts: 61

Rep: Reputation: 15
Packet getting dropped using iptables


I use Fedora Core 3 and I am connected to the internet via DSL. My computer has two lan cards - One for the intenet connection - and one that I use to connect my Laptop.

I configured iptables to act as router but I am unable to connect to the internet from my Laptop.

The steps I took -

1) Enabled IP forwarding - echo 1 > /proc/sys/net/ipv4/ip_forward

2) iptables configuration -

./iptables -t nat -A POSTROUTING --out-interface eth0 -j MASQUERADE
./iptables -A FORWARD --in-interface eth1 -j ACCEPT

I even switched to using the ip addresses of my cards

./iptables -t nat -A POSTROUTING --out 172.16.15.5 -j MASQUERADE
./iptables -A FORWARD --in-interface 191.168.0.1 -j ACCEPT

3) I switched on logging-

./iptables -A INPUT -j LOG --log-prefix "INPUT_DROP: "
./iptables -A OUTPUT -j LOG --log-prefix "OUTPUT_DROP: "

4) I set up route -

./route add default gw 172.16.0.1 dev eth0
./route add -net 192.168.0.0 netmask 255.255.255.0 gw 172.16.0.1 dev eth0

But I am unable to connect to the net from my Laptop (Using WIndows XP)

I checked the logs and this is what I find.

Feb 2 14:11:01 server kernel: INPUT_DROP: IN=eth1 OUT= MAC=00:e0:4c:04:71:46:00:c0:9f:94:a4:17:08:00 SRC=192.168.0.2 DST=192.168.0.1 LEN=68 TOS=0x00 PREC=0x00 TTL=128 ID=319 PROTO=UDP SPT=1040 DPT=53 LEN=48

Why is this happening?
 
Old 02-03-2006, 03:44 AM   #2
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Quote:
Originally Posted by gugabaga
Feb 2 14:11:01 server kernel: INPUT_DROP: IN=eth1 OUT= MAC=00:e0:4c:04:71:46:00:c0:9f:94:a4:17:08:00 SRC=192.168.0.2 DST=192.168.0.1 LEN=68 TOS=0x00 PREC=0x00 TTL=128 ID=319 PROTO=UDP SPT=1040 DPT=53 LEN=48
it's a UDP packet destined to port 53 on the linux box... so i would assume the windoze box is trying to use a DNS daemon on the linux router... so you either need to make sure you have the dns daemon running on the router (and add the appropriate iptables rules to allow the windoze box to connect to it) or you need to configure the windoze box to use your ISP's DNS servers instead of 192.168.0.1...

just my ...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Packet dropped....while Netfiltering... alwaysrookie Programming 0 12-10-2005 02:30 AM
iptables packet logging netguy2000 Linux - Networking 2 12-24-2004 03:29 AM
Dropped packet logging jonr Linux - Networking 6 11-18-2004 07:25 AM
syslog is filled with iptables DROPPED messages TLV Linux - Networking 3 10-06-2004 04:23 AM
How does iptables handle packet ? mrpc_cambodia Linux - Security 3 07-24-2004 04:25 AM


All times are GMT -5. The time now is 03:56 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration