Linux Box as a Router

Tags:
Linux
Networking
Hello Everyone. I have posted many replies to others questions and this is my first post seeking help I am trying to setup a RedHad 9 Linux box as router. I have searched documentation and even have a few Linux books. But they are lacking (or more than likely I am lacking since I am fairly new to Linux). I cant seem to get traffic from one network to traverse to the other. My Config eth0 IP 111.111.111.160 (Default gateway 111.111.111.1 Firewall) this is the primary network. eht1 192.168.1.254 default gateway 111.111.111.160 (I presume the gw is correct) secondary network. I have read were IP forwarding must be enabled with echo "1" > /proc/sys/net/ipv4/ip_forward I have done this I cant seem to get (ping) from the 192.168.1.0 network to the 111.111.111.0 network and vice versa. I can ping from the eth0 IP 111.111.111.160 from the 192.168.1.0 network And I can ping eth1 IP 192.168.1.254 from the 111.111.111.0 network, but not to any other computer on either network. Now from all that I have read this is a pretty simple process and I am probably over looking something easy. If someone could point me in the right direction I would appreciated it. Thanks in advance The HumbleNetAdmin

Answer Wiki

Thanks. We'll let you know when a new response is added.

If I read your post correctly, your setup looks something like this (pardon the shortened IP addresses for simplicity).

192.168.1.0 +——-Linux Box——-+
+————+Eth1 Eth0+—+ FW
+1.254 111.160+ +111.1
+———————–+

If this diagram is correct, the default gateway for the Linux box needs to point to 111.1 (FW) or it will just go in circles until the TTL expires.

If I’ve not understood your description correctly, then please repost and correct the picture.

Take care,

Bob

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • HumbleNetAdmin
    Bob eth0 (111.111.111.160) default gateway is 111.111.111.1 eth1 (192.168.1.254) default gateway is 111.111.111.160 Here is the results from route; 192.168.1.0 * 255.255.255.0 eth1 111.111.111.0 * 255.255.255.0 eth0 169.254.0.0 * 255.255.0.0 eth1 172.0.0.0 * 255.0.0.0 lo default 111.111.111.1 0.0.0.0 eth0 Thanks
    0 pointsBadges:
    report
  • Bobkberg
    Well, I just learned that you CAN'T post ASCII graphics. Apparently the system that processes these replies extracts what it sees as extraneous spaces - especially leading ones. Anyhow.... I believe that your problem is that you've made the default gateway for eth1 another port inside the system. Try making the default gateway for both Eth0 and Eth1 to be 111.111.111.1. Then make sure that the route to 111.111.111.0 is Eth0 (sorry - tired of all those 1's) Then check (and add as necessary) routes for the 111.111.111.0 and 192.168.1.0 network with the gateway referenced to the appropriate port or external address. The other thing I noticed in your last post was the presence of a 169.254.x.y IP address on Eth1. This is usually an indication of a DHCP client that could not get an address. Not a good sign on a system that is supposed to have static IP addresses. Bob
    1,070 pointsBadges:
    report
  • ColinNZ
    With Redhat9 you have a choice of using IPCHAINS or NETFILTER/IPTABLES Check out the following HOWTO documents for IPCHAINS, or the link below for NETFILTER/IPTABLES IPCHAINS-HOWTO http://www.tldp.org/HOWTO/IPCHAINS-HOWTO.html IP-Masquerade-HOWTO http://www.tldp.org/HOWTO/IP-Masquerade-HOWTO/index.html Netfilter/IPTables http://www.iptables.org/ Colin
    0 pointsBadges:
    report
  • Blessen
    It sometimes takes a few minutes for routing to actually happen on Red Hat. THere is a kernel config option under the system settings->more settings (Not sure .. not infront of my Linux box) where you specify to allow ip forwarding. Check there to see if it is actually enabled. ALso turn the firewall off if you have installed it,until it starts to route.
    0 pointsBadges:
    report
  • HumbleNetAdmin
    Thanks to all who posted I have found (I think) what the issue was. Needed to out a route to my firewall for 192.168.1.0 subnet. Thanks again The HumbleNetAdmin
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following