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 4 differnet networks x.x.1.x,x.x.2.x,x.x.3.x,x.x.x.4. so setup a linux machine with 4 lan cards. enabled forwarding in /etc/sysctl.conf.
but i have doubt configuring iptables to make 4 networks communicate.
I have squid.
|--------|
WAN eth0| squid |eth1 LAN
|--------|
preivously i my lan sysetms get internet through proxy but unable to ping 8.8.8.8 (google dns), i mean external ip's through squid from termial. I found a solution that NAT has to be enabled on my squid server. so i did as below and now
Quote:
they are pinging external ip's and connect my servers on branch via putty.
Quote:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth1 -j ACCEPT.
Quote:
If i want to make my router work, do i have to apply above NAT rule for my four lan card or what ?
Please help me set up a linux router with four networks.
i have 4 differnet networks x.x.1.x, x.x.2.x, x.x.3.x, x.x.x.4
Typo there I think? Last must be x.x.4.x
Now I'm not quite sure what you want to achieve, also you didn't say what router you have?
Normally, traffic is allowed from inside to outside (WAN), but not from outside to inside.
If you want to allow traffic to servers on inside (be it LAN, squid or eth1) you must open a port in the firewall/router for that.
If you don't have public IP:s on the 3 inside networks then answer is Yes, you need to add NAT rules.
That's what I can say so far, please return with more info about adressing - private or public ip:s? - and spec of router.
thanks for reply. Now i'll give you my exact requirement.
Quote:
i have 4 networks in my office.x.x.1.x, x.x.2.x, x.x.3.x, x.x.4.x
. now i want to join all the 4 networks using linux router, i mean i configured a centos6 system as router. hope you got what my router is?. Now please tel me what to do. no interface is connected to internet, i have squid for want to connected to one of the 4 network cards of linux router. If it's not clear leave about squid.
Quote:
just tell me how to confiure linux machine as router to join all the four networks connected to linux router system.
thanks for reply, sorry if i misguide u. I didn't do it completely i just added "1" to
Quote:
/proc/sys/net/ipv4/ip_forward
, hope that what u want to see as out put. I want to you to tel me how to configure iptable to make my router system complete.please help me. i did nt configure any thing in iptables. below configuration which i posted in the beging was on another server.
Quote:
they are pinging external ip's and connect my servers on branch via putty.
Quote:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth1 -j ACCEPT.
Iptables are not configured in current system which i want to configure as router.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.