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 11-23-2008, 10:31 AM   #1
h725
Member
 
Registered: Apr 2008
Posts: 114

Rep: Reputation: 15
ip_forward, routing


Hi, this is the scenario:

LAPTOP: eth0 10.0.0.1/24

PC has 2 interfaces: eth0 10.0.0.2/24 and eth1 192.168.1.1/24

Here the connections:

laptop(eth0) <--------> (eth0)PC(eth1)

PC has ip_forward = 0.


on "laptop" I type:

# route add -net 192.168.1.0/24 eth0

Question is: why I'm able to ping 192.168.1.1 if the ip_forwarding between the 2 interfaces is off?

Thank you.
 
Old 11-23-2008, 02:17 PM   #2
bmarx
Member
 
Registered: Dec 2004
Distribution: Slackware, Arch, FreeBSD
Posts: 202

Rep: Reputation: 34
The PC is not forwarding packets if the packets are destined for the localhost, even if on a different interface.
 
Old 11-23-2008, 02:19 PM   #3
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 488

Rep: Reputation: 78
because an IP really isnt "bound" to a specific interface. The kernel owns it and knows which interface to route the traffic.

Since the kernel "owns" both 10.0.0.2 and 192.168.1.1 it is able to properly respond on the 10. interface to your ping to 192.168.1.1 since it does not require any forwarding to another network. It never leaves the PC system.
 
Old 11-24-2008, 07:10 AM   #4
h725
Member
 
Registered: Apr 2008
Posts: 114

Original Poster
Rep: Reputation: 15
Thank you!
 
  


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
Routing and ip_forward endfx Linux - Networking 10 06-19-2007 08:28 PM
lost rc.ip_forward hardknox Slackware 5 03-24-2005 04:32 PM
ip_forward mikz Slackware 2 02-01-2005 04:49 AM
IP_Forward Neur0tek Linux - Newbie 9 05-09-2002 09:44 AM
ip_forward Sathe Linux - Networking 2 10-19-2001 12:53 AM

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

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