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.
OK, I've read through all the IP forwarding posts and I'm still confused....
Here's the environment:
-Red Hat 9.0
-2 Ethernet Interfaces (99.99.99.1, x.x.x.0 & 10.10.20.189, x.x.x.0)
-The 99.99.99.1 interface is the def gateway of the 99.99.99.x subnet
-The 10.10.20.189 interface is a member of the 10.10.20.x subnet, has a default gateway of 10.10.20.1
-The 99.99.99.x network needs to pass through the linux box, then onto the 10.10.20.x network to get out to the world.
Question:
The 10.10.20.189 interface has mask 255.255.255.0, & gw of 10.10.20.1
The 99.99.99.1 interface has mask of 255.255.255.0, what should its gateway be? blank?
Main Question:
How do I get this thing to route between the 10.10.20.x and 99.99.99.x subnets?
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
You should only have one default gateway, which is represented as the route for:
0.0.0.0 netmask 0.0.0.0
That route is the "default" which is where you send all traffic that isn't going to an IP on one of the local subnets. A local subnet is anything that falls in the netmask of one of your configured network cards (or loopback).
You'll notice that ifconfig does not have an argument for "gateway", only IP, netmask, and various other options that you can generally ignore.
You need to enable IP forwarding in order for that box to route traffic between the subnets. You'll also need to put a route on the default gateway for the 10.10.20.x subnet that routes traffic for 99.99.99.x back to 10.10.20.189.
By the way, 99.99.99.x falls in a netblock that is reserved by IANA, but it may be delegated to a Regional Internet Registrar in the future, so making use of that netblock for internal number is very bad form. You should also use IPs from the "special" reserved blocks listed in RFC1918.
OK.
I enabled IP Forwarding.
Routing tables look correct now (after correcting the def gateway issue)
From the box, I can ping devices on the 99.99.99.x network, but I cant ping anything on the 10.10.20.x subnet, 'Destination Host Unreachable'
I can ping my local 10.10.20.189 interface.
Added a static route in the def gateway for the 99.99.99.x network.
I can ping the 10.10.20.189 interface from devices on the 99.99.99.x network, but can't ping anything else on the 10.10.20.x network (nor can the linux box)
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
Quote:
Originally posted by zaphodiv Show us the routing table. You'll also need to put a route on the default gateway for the 10.10.20.x subnet that routes traffic for 99.99.99.x back to 10.10.20.189.
Chort means that you have to set a route on the box which is 10.10.20.1, not on your box.
Correct. I guess I wasn't clear enough about that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.