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 issued "echo 1 > /proc/sys/net/ipv4/ip_forward" to enable routing also.
from the pc acting as the router i can ping and resolve addresses to everything on the network and also browse the internet. this is working great. i can ping all local ip addresses also. i also have bind9 installed to act as a DNS server for the clients on the 10.0.0.0 and 11.0.0.0 networks.
i have set up a pc to test the connection with the following ip configuration.
the client can ping all 3 ip addresses on the router, and can resolve outside world ip's. eg google
however i cannot ping 192.168.0.1 which is the gateway of the router nor any other ip within the 192.168.0.0 network. which means i cant get to the internet from my 10.0.0.0 and 11.0.0.0 networks.
i have flushed all iptables incase something might be getting in the way by "iptables -F"
i have been googling and searching for what i could be doing wrong for about 3 days. is there anything i may have missed?
Looks like, to me, that the gateway (192.168.0.1) doesnt know about your other 2 networks. It probably needs a route that says that the 10.0.0.0/24 network is reachable via the 192.168.0.150 machine, and also the same for the 11.0.0.0/24 network.
You packets are probably reaching their destination, but the return path is not know.
If the packets are just being routed, the firewall would need to know about those networks. Being just routed, the packets are forwarded, hence the connections would not be coming from the .150 machine. They would be coming from the 10. or 11. network.
Now, if the .150 machine was doing NAT, it would "rewrite" the packets to make them appear to come from the 150 host. In this case the firewall should not need to know about the other 2 networks behind the .150 host.
i was able to get it working with some help from a friend who mentioned trying this:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
and that did the trick. on what docalton was saying, I'm assuming this masks the packets so that to any upstream route it looks like its coming directly from 192.168.0.150.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.