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.
if you want a connection to not be possible, explicitly blocking is always the best way. I would say your approach is preferable that simply putting in a configuration that omits some functionality. They'd both do the same job really, but an explicit deny is easier to read and more secure.
I don't get u, if you say i'm correct...thanks for your reply. By the way please look at the below thread.
http://www.linuxquestions.org/questi...ks-4175417938/
I posted this many time's but u never come accross my thread, my badluck. Please go through it. I want to buil a router to join 4 networks with a linux system using 4 lan cards, enabled ip forward in /etc/sysctl.conf. What i'm stucking at iptables.i know i should use masquerade. my doubt is do i have to apply rule for all the four cards ?
In most cases, you would only enable MASQUERADE on an interface which is directly connected to the internet. In your other thread you suggest that you don't have an internet connection, is this correct?
thanks for your reply, i think i confused. i was talking about squid as an example plese leave it in this post. Now i'll tell you my problem.
Quote:
I'm working with four networks now in real. Say A, B , C , D.
Now i have to make all the four networks to communicate with each other. So as you want to know if i enabled packet forwarding in /etc/sysctl.conf file, I did it. i enabled
Quote:
net.ipv4.ip_forward = 1
, so next part is configuring iptables. please tell me how to configure. for all the four nic cards. please help me. As if now no lan card is connected directly to internet.
If you have 4 networks and wish to route between them, you do not need any masquerading.
Code:
iptables -t nat -F
iptables -I FORWARD -j ACCEPT
Once you have input those commands, your box should be able to route traffic between the various networks. If you are having trouble, make sure that you have set the gateway on your other machines correctly.
If you are still having issues after this, please make a network diagram with your current configuration.
Last edited by SuperJediWombat!; 07-31-2012 at 02:57 AM.
thank you, ur right it masquerades all the interfaces am i right ? what if i don't want "A" netowrk not communicate with "C" any rule to drop reques from "A" to "C"
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.