LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   ubuntu gateway server for connecting different networks (https://www.linuxquestions.org/questions/linux-networking-3/ubuntu-gateway-server-for-connecting-different-networks-714492/)

sajina 03-26-2009 12:15 AM

ubuntu gateway server for connecting different networks
 
Hai....


Please help anyone for solving this problem, because i am a beginner in administration.

I have setup an ubuntu gateway server by using four NIC cards.

eth0 :210.212.235.107 is connected to the internet
eth1 :192.168.1.222 is connected to the local network
eth2 :192.168.2.222 is connected to another network


Here 192.168.1.222 is the gateway for 192.168.1.0 network and 192.168.2.222 is the gateway for 192.168.2.0 network.These network configurations are working fine, but i want to block inter network communication ie from 192.168.1.0 network to 192.168.2.0 network,i want to block the communication for securing the local networks more.I know iptable rule is enough for this purpose .But i cant find the apt rule for this purpose.If anybody knows the rule for blocking the inter network communication ,please give me a reply.

maxut 03-26-2009 03:38 AM

if u want to allow internet connection only (the communication between local networks will be dropped by iptables), u can try following rules:
Code:

iptables -F FORWARD
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i eth1 -s 192.168.1.0/24 -o eth0 -j ACCEPT
iptables -A FORWARD -i eth2 -s 192.168.2.0/24 -o eth0 -j ACCEPT
iptables -P FORWARD DROP

i hope i could understand u well.

regards


All times are GMT -5. The time now is 02:34 PM.