Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a setup like the following with IP addresses of the different interfaces shown:
Host A (3.0.0.2)<---->(3.0.0.1)Linux Box(3.0.1.1)<----->(3.0.1.2)Host B
I am trying to send packets from Host A to Host B and vice versa, however I cannot get Linux to forward the packets. I have tried the following steps:
set net.ipv4.ip_forward = 1 in /etc/sysctl.conf
echo 1 > /proc/sys/net/ipv4/ip_forward
reboot
I can ping fine on all the interfaces (except of course I cannot ping between Host A and Host B). I am running Red Hat release 5.2. Below is some output from tcpdump, netstat, route, and ifconfig - all from the Linux Box. I can't seem to get any useful information as to why the packets aren't going through. Can someone enlighten me as to how to set this up properly?
Hey Acid, actually the two "hosts" on either side are traffic generators so I can force them to send packets. As you can see from the incrementing Rx counters from "ifconfig eth2," packets are received by the Linux Box, and somewhere in the kernel they are disappearing. The tcpdump shows (I think) that the IP header is correct.
Hmm, ok, deleting what i'd previously written here, yeah OK so traffic is hitting it. do you have any firewall stuff running? What does iptables -L -n -v say?
let's cat /proc/sys/net/ipv4/ip_forward to prove it's set. You did an echo and then reboot the box, so that will wipe out that config so you've only got the first sysctl detail being relevant.
Last edited by acid_kewpie; 07-14-2009 at 02:38 PM.
Hey Acid, thanks for helping me out. It looks like iptables output might give us a clue. I see that FORWARDING target is some firewall and large number of packets are getting counted as "REJECT." I'm not very familiar with iptables, I imagine I can just turn this firewall off and ACCEPT all packets on the FORWARD chain?
BTW, I did cat /proc/sys/net/ipv4/ip_forward and it is set, as is /proc/sys/net/ipv4/conf/eth2 and /proc/sys/net/ipv4/conf/eth3.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.