LinuxQuestions.org
Review your favorite Linux distribution.
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 04-22-2014, 03:01 AM   #1
NdAd
LQ Newbie
 
Registered: Jul 2010
Posts: 18

Rep: Reputation: 0
Can't forword packets to default gateway


Hi guys,

I wonder why I can't forward packets from one interface to default gateway through other interface in my linux host it only works when I initiate ping to this specific DGW from same host.

I tried to invistigate it further with tcpdump and noticed icmp frames comes in from one interface but not getting out from the interface on same network as DGW(eth0).

When I'm pinging DGW from the host it suddenly works! why ?
Some output below:

my PC is 10.60.247.139
Code:
[root@host1 ~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.60.73.0      0.0.0.0         255.255.255.0   U         0 0          0 eth2
10.60.72.0      0.0.0.0         255.255.255.0   U         0 0          0 eth0
10.60.74.0      0.0.0.0         255.255.255.0   U         0 0          0 eth3
10.60.76.0      0.0.0.0         255.255.255.0   U         0 0          0 eth1
0.0.0.0         10.60.72.59     0.0.0.0         UG        0 0          0 eth0

[root@host1 ~]# tcpdump -n -i eth3 icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth3, link-type EN10MB (Ethernet), capture size 96 bytes
05:52:47.969541 IP 10.60.247.139 > 10.60.74.19: ICMP echo request, id 1, seq 10578, length 40
05:52:52.868889 IP 10.60.247.139 > 10.60.74.19: ICMP echo request, id 1, seq 10579, length 40
05:52:57.899993 IP 10.60.247.139 > 10.60.74.19: ICMP echo request, id 1, seq 10580, length 40
05:53:02.870666 IP 10.60.247.139 > 10.60.74.19: ICMP echo request, id 1, seq 10581, length 40

4 packets captured
4 packets received by filter
0 packets dropped by kernel

[root@host1 ~]# tcpdump -n -i eth0 icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes

0 packets captured
0 packets received by filter
0 packets dropped by kernel
I have many hosts with same issue. All are VMs with LNX 5.4.3.
 
Old 04-22-2014, 04:03 AM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Your PC has IP address 10.60.247.139, but lives on the 10.60.74.0/24 subnet? And, why do you expect the packet to be forwarded out through eth0 when the destination, 10.60.74.19, also lives on 10.60.74.0/24 (eth3)?

I suspect the packet was dropped as a martian. Check your logs for martian source, or google for the appropriate settings in sysctl to turn on/off martian logging/dropping.
 
Old 04-22-2014, 05:07 AM   #3
NdAd
LQ Newbie
 
Registered: Jul 2010
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Berhanie View Post
Your PC has IP address 10.60.247.139, but lives on the 10.60.74.0/24 subnet? And, why do you expect the packet to be forwarded out through eth0 when the destination, 10.60.74.19, also lives on 10.60.74.0/24 (eth3)?

I suspect the packet was dropped as a martian. Check your logs for martian source, or google for the appropriate settings in sysctl to turn on/off martian logging/dropping.
Thanks for your reply.
I tried to ping the host through 10.60.74.0/24 and the "echo request" reached the host's dedicated interface (eth3).
I'm expecting the packet to be forwarded through eth0 since host can't reply to me on same network 10.60.247.x , since none is relevant on its routing table, so host should reply only through default gateway assigned in eth0 network.
There's nothing wrong with it.

packet apperently droppen when reached to host but don't think because it identified as martain. 10.0.0.0 network reserved to use in private boundries ,It's not routed outside my company's network. Logs didnt say a thing about it either.
 
  


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
adding default gateway and aditional gateway veru.naresh Linux - Networking 1 06-13-2012 07:34 AM
normal default gateway reapperas with openvpn redirect-gateway jonnytabpni Linux - Networking 2 04-23-2009 02:11 PM
Mornitoring passing-through packets on tha gateway simon_qwl Programming 4 05-31-2007 10:16 PM
No packets received at application-level without a default gateway urban_olofsson Linux - Networking 3 10-29-2004 08:51 AM
Logging\Filtering Packets Through a Gateway ASP Linux - Software 2 10-21-2003 10:11 PM

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

All times are GMT -5. The time now is 10:41 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