LinuxQuestions.org
Help answer threads with 0 replies.
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 12-06-2007, 03:11 AM   #1
culin
Member
 
Registered: Sep 2006
Distribution: Fedora Core 10
Posts: 254

Rep: Reputation: 32
understanding IP forwarding


Hi friends,
i am confused with IP forwarding and masqerading and port forwarding... i have a setup as below.. in which of these categories this falls in and please gimme a solution in solving this problem...

SETUP:

PC A (IP addr is 192.168.178.182 )with windows XP-> connected to eth0 of a board running linux (LinPC =eth0 IP is 192.168.178.244) Gateway of PC A is eth0 IP

PC B (IP addr is 192.168.174.111 )with windows XP-> connected to eth1 LinPC
=eth1 IP is 192.168.174.119) Gateway of PC B is eth1 IP

and

CASE 1: echo 0 > /proc/sys/net/ipv4/ip_forward
Now ping from PC A to PC B NOT POSSIBLE but ping from PCA to eth0 and eth1 is both possible (should this ping both eth0 and eth1 IP ??? i doubt )

CASE 2: echo 1 > /proc/sys/net/ipv4/ip_forward
Now ping from PC A to PC B is POSSIBLE also ping from PCA to eth0 and eth1 is both possible.

Now the problem is when i connect eth1 to LAN instead of PC B with echo 1 > /proc/sys/net/ipv4/ip_forward
i am not able to ping from PC A to any IP in the network to which the eth1 is connected.
Please help me solving this problem...or gimme some alternate solution to solve this problem...
thanks...
 
Old 12-06-2007, 06:50 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I assume that the netmask in both subnets is 255.255.255.0.

Check the modules that are running in the Linux machine (with eth0 & eth1). I once used my Laptop to route internet traffic (for my Desktop) via the laptop's wireless interface. I found that I needed to load a kernel module to do it. ( At the time it was either called ip_conntrack or tcp_conntrack ). I think you need the nf_conntrack kernel module loaded. My router was a NAT router so I didn't need to configure my firewall for NAT translation.

Look at the network configurations on the XP machines. What default gateway address do you have for them? If they don't have their own internet connections on another interface, use the Linux box's ip address on that subnet. If an XP does have an internet connection then add a route for the other subnet as well.

Also, you should look at the route configuration on the Linux host. Do you have a route for each subnet? You probably do, but you will want to check anyway.
 
  


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
Mail Forwarding in postfix/maildrop/redhat (like yahoo mail forwarding) topcat Linux - Software 1 08-31-2007 12:10 PM
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
Understanding port forwarding DIGITAL39 Linux - Security 4 12-18-2006 11:57 AM
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 12:08 PM
port forwarding and packet forwarding syrtsardo Linux - Newbie 2 07-03-2003 10:37 AM

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

All times are GMT -5. The time now is 05:29 AM.

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