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.
How do I edit the iptable? I have two Interfaces on the gateway - one that is connected to the Internet and one that is connected to the hub. The clients are also connected to the hub. I want the clients to make requests via the gateway - how do I set up IP Masquerade?
if eth0 is facing the Internet and eth1 is facing the LAN, then this would do it:
Code:
iptables -P FORWARD DROP
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -m state --state NEW -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Thanks for the info - followed your instructions but I still no joy. eth0 is connected to the Internet - fine- when I try to enable eth1 I get the message "Determining IP information for eth1...." then nothing?
Originally posted by JustJD Thanks for the info - followed your instructions but I still no joy. eth0 is connected to the Internet - fine- when I try to enable eth1 I get the message "Determining IP information for eth1...." then nothing?
well, my post assumed your interfaces were already configured...
sounds like your eth1 is trying to find a DHCP server... perhaps you should instead assign it a static ip address like 192.168.0.1 on subnet 255.255.255.0 for example??
If eth1 is connecting to the hub using the static IP address 192.168.0.1 will it then be listening for traffic? What address do the other clients use to request a connection from the gateway to the Internet?
Say: ifconfig says that the address of one client connected to the hub is 192.168.0.104, the next is 192.168.0.103, and the static address I assigned to gateway is 192.168.0.1, which is connect to the uplink jack of the hub.
Also don't forget to provide the clients with the proper DNS server IPs (your ISP).
This will allow them to access websites by name e.g. www.google.com instead of 66.249.85.104
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.