LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 05-15-2012, 11:12 PM   #1
onzi
LQ Newbie
 
Registered: May 2012
Posts: 3

Rep: Reputation: Disabled
how to make connections?


http://i.imgur.com/E7IZu.jpg

Hallo everyone
Here on the picture are 3 PCs.

Default policy to DROP for all chains. Start each connectionless be initialized respectively by
PC1, PC2 or PC3 in the specified instructions.
PC1 can make contact with the PC3, but can not make the connection to PC2.
Being able to connect to abv.bg, but can not to dir.bg.
PC2 can make the connection to PC1. Being able to connect to abv.bg, but can not to dir.bg
PC3 can not make the connection to PC1. Being able to connect to dir.bg, but can not to abv.bg

can someone help me with the algorithm?

Last edited by onzi; 05-15-2012 at 11:15 PM.
 
Old 05-16-2012, 02:24 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
The route can be used between PC, such as PC1 and PC2. The policy is used to control particular service, such as abv.bg.
 
Old 05-17-2012, 05:40 AM   #3
onzi
LQ Newbie
 
Registered: May 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
What do you mean? I just need IP tables command in linux to do with the above conditions
 
Old 05-17-2012, 08:12 AM   #4
nikmit
Member
 
Registered: May 2011
Location: Nottingham, UK
Distribution: Debian
Posts: 178

Rep: Reputation: 34
Permitting connectons between PCs is not complicated.
Code:
iptables -A FORWARD -s PC1.ip.here -d PC3.ip.here -j ACCEPT
iptables -A FORWARD -s PC3.ip.here -d PC1.ip.here -m state --state RELATED, ESTABLISHED -j ACCEPT
iptables -A FORWARD -s PC3.ip.here -d PC1.ip.here -j DROP
That would be the principle, you can apply it to networks or drill down to protocols/ports, and repeat for all client combinations.

Controlling access to websites can be done better with a transparent or authenticated squid proxy.
You could try and do it in iptables but I suspect the results will not be as good.
Code:
-A FORWARD -s PC1.ip.here -p tcp -m tcp --dport 80 -m string --algo bm --string "dir.bg" -j REJECT
 
Old 05-17-2012, 02:30 PM   #5
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
I means that if you want to control entire network, such as between PC, it is simple to use route instead of policy.
 
Old 05-19-2012, 05:36 AM   #6
onzi
LQ Newbie
 
Registered: May 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Can you tell me, how to do that step by step, cause I have never used Linux before.
I mean, where should I write the IP tables command.

Last edited by onzi; 05-19-2012 at 05:38 AM.
 
  


Reply



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
how to make X.org listen for incomming connections ? qwijibow Linux - General 24 12-23-2009 02:42 AM
Can't make inbound connections, and servers won't activate (no ports available) CJ Chitwood Linux - Networking 7 01-22-2008 07:53 PM
cannot make outbound anonymous ftp connections kvankawala Linux - Software 1 03-23-2004 12:30 PM
preventing users to make outgoing connections Shroom Linux - Security 5 06-15-2003 05:57 AM
using 2 ISDN connections to make one fast one zarnok Linux - Networking 0 09-07-2001 03:50 PM

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

All times are GMT -5. The time now is 10:15 PM.

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