Need help setting up routing tables with an adsl hub
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.
Need help setting up routing tables with an adsl hub
I would appreciate any help setting up my home network on Mandrake 10.0
My network consists of the following. One computer with two ethernet cards ( PC A ) .
PCA connects to the internet via eth 1 and eth 0 connects to the adsl hub. The rest of my
machines us the hub ( set up with dhcp ).
How do I 1. Set up PCA as a gateway to the internet and not the adsl hub .
2. How do I set up the routing tables on PCA so that it can see the
network on the hub.
It could be that you have more than one network, it depends on that ADSL hub.
If it really is functioning only as a hub, all you need to do is configure DHCP to assign PCA's eth0 as default gateway.
All computers in a local network can see each other without routing.
In order to help you I need the following information:
from PCA the output of
ifconfig
route
from one of the machines on the hub the same
(if you are using windows use winipcfg for w98 and ipconfig /all for w2k xp here i want to know the default gateway)
PS I asume that the adsl hub was used to connect to the internet as a adsl router ?
and are you able to program that router ?
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 192.168.0.1 255.255.255.0 UG 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
172.16.48.0 0.0.0.0 255.255.248.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 172.16.48.1 0.0.0.0 UG 0 0 0 eth1
192.168.0.1 is gateway to the network that the hub is in charge of.
172.16.48.1 is the internet gateway. I can see the internet from eth1 interface. from PC A
I can ping other machines on the 192.168.0.x network. and they can ping PC A. But they
cannot see 172.16.48.1 which is my internet gateway. I want to use PC A to forward requests
to 172.16.48.1
I tried setting up routed but that changed my routing tables to unusable, I had to keep on changing
them by hand. I couldnt understand the /etc/gateways file to well.
Any further information needed will be promptly supplied.
There are 2 things you need to do:
1. Enable forwarding on PCA:
# echo "1" >> /proc/sys/net/ipv4/ip_forward
2. Enable NAT/masquerading: Computers can't use internal IP's on internet, so PCA has to translate them. I think this is correct:
# iptables -t nat -o eth1 -j MASQUERADE
I'm not completely sure. Try it, or search for more advice.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.