LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-29-2013, 11:46 AM   #1
username1
LQ Newbie
 
Registered: May 2010
Posts: 10

Rep: Reputation: 0
3 network card, how to forbidden communication between two nic


Hello,

I have linux (Debian) computer with 3 network adapters.

etho - 192.168.100.1 - local network
eth1 - 192.168.1.1 - internet
eth2 - 192.168.7.1 - wireless router connected to it

So, wireless router is connected to eth2.
I want just to forbidden communication between eth2 and eth0. Because eth0 is local network and eth2 is public where users can connect.

How to do that with iptables?

thanks
 
Old 07-29-2013, 12:49 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,348

Rep: Reputation: Disabled
Code:
iptables -I FORWARD -i eth2 -o eth0 -j DROP
This will add the rule at the very top of the FORWARD chain in the filter table. Note that it will also catch any responses to connections initiated from the eth0 side.
 
Old 07-29-2013, 05:38 PM   #3
username1
LQ Newbie
 
Registered: May 2010
Posts: 10

Original Poster
Rep: Reputation: 0
So with that command users from eth2 (192.168.7.0) cannot ping or have access to eth0 (192.168.100.0)? Am i right?
 
Old 07-29-2013, 06:19 PM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,348

Rep: Reputation: Disabled
Correct.

The command says "add a rule at the top of the FORWARD chain (-I FORWARD), saying that any packets entering eth2 (-i eth2) bound for eth0 (-o eth0) should be processed by the DROP target (-j DROP)".

The FORWARD chain is for packets not destined for the machine itself. The DROP target does just one thing: it discards the packet.
 
Old 07-29-2013, 06:19 PM   #5
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,348

Rep: Reputation: Disabled
(duplicate, removed)

Last edited by Ser Olmy; 07-29-2013 at 07:43 PM.
 
Old 07-30-2013, 04:08 AM   #6
username1
LQ Newbie
 
Registered: May 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Thank you for help and explanation.
Regards
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Network interface card (NIC) calexander Linux - Newbie 3 05-14-2010 10:41 PM
Fault in KDE processes communication: Could not read network communication list Magnus Johansson MEPIS 0 03-30-2008 01:50 PM
Which NIC (network adapter card) should I buy for Linux? kuser:) Linux - Newbie 9 02-07-2008 07:08 PM
Configuring two NIC card and two network angadi Linux - Networking 4 07-17-2007 03:44 AM
many VNIC's (Virtual Network card) on one physical NIC posterman Linux - Networking 9 07-06-2006 01:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration