LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-05-2004, 12:18 PM   #1
cipx2
LQ Newbie
 
Registered: Aug 2004
Posts: 5

Rep: Reputation: 0
Help connecting two Lan's on same server with IPTABLES


Hi all,

I need sharing folders and other gadgets to work betwen only 2 PC's on different LANs that are connected to same Linux SERVER running IPTABLES.

The layout:

192.168.0.255 .... ----- PC01 -- PC02 -- PC03 ----- |
....................................................................SERVER =====
192.168.20.255 ...----- PC21 -- PC22 -- PC23 ------|

I need to allow access only between IP_PC02 and IP_PC21 all ports.
Can someone help with the IPTABLES rules please?

Thanks
Cip
 
Old 08-05-2004, 02:58 PM   #2
Charalambos
Member
 
Registered: Aug 2004
Location: Switzerland
Distribution: debian
Posts: 149

Rep: Reputation: 15
Re: Help connecting two Lan's on same server with IPTABLES

Quote:
Originally posted by cipx2
I need sharing folders and other gadgets to work betwen only 2 PC's on different LANs that are connected to same Linux SERVER running IPTABLES. [/B]
And do you use samba for that purpose? Or what type of traffic do you want to allow?
 
Old 08-05-2004, 05:36 PM   #3
cipx2
LQ Newbie
 
Registered: Aug 2004
Posts: 5

Original Poster
Rep: Reputation: 0
No, the 2 PC's are windoze virused. I just wanna share resources of PC02 with PC21 and vice-versa (nothing to do with the server, u can only see it as a machine that has nics, Linux and iptables)and, by default, everything is closed between the two lans. I need to open everything between those 2 PC which are trusted. So i need the rules to be appended for communication between eth0 (192.168.0.255) and eth20 (192.168.20.255) on the server but ONLY for IP_PC02 and IP_PC21. I hope i explained better this time.

Thanks.
Cip
 
Old 08-05-2004, 05:40 PM   #4
cipx2
LQ Newbie
 
Registered: Aug 2004
Posts: 5

Original Poster
Rep: Reputation: 0
PS. And I need everything opened, all kind of traffic. Those PC's have the same user (person) used for testing pourposes and should behave like in the same lan.

Thanks again
Cip
 
Old 08-05-2004, 07:47 PM   #5
PiLgRiM
Member
 
Registered: Jul 2004
Location: New York
Distribution: SuSE
Posts: 38

Rep: Reputation: 15
basic FORWARD policy rules need to be applied like:

$iptables -P FORWARD DROP
$iptables -A FORWARD -i eth0 -s $IP_PC21 -d $IP_PC02 -j ACCEPT
$iptables -A FORWARD -i eth1 -s $IP_PC02 -d $IP_PC21 -j ACCEPT
 
Old 08-06-2004, 02:14 AM   #6
cipx2
LQ Newbie
 
Registered: Aug 2004
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks PiLgRiM.
Those are the rules I wrote myself in the firewall script (eth20 instead eth1 as I described the network).
I thought there's something wrong with it.

The problem is the PC's still don't see each other. Must be something else. I need go there and investigate.

Thanks folks for the help.
Cip
 
Old 08-06-2004, 02:54 AM   #7
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
Quote:

The problem is the PC's still don't see each other.

As in they don't see each other in Windows network neighbourhood or can't ping each other?
 
Old 08-06-2004, 05:02 AM   #8
cipx2
LQ Newbie
 
Registered: Aug 2004
Posts: 5

Original Poster
Rep: Reputation: 0
Don't know yet. I am doing remote admin so i'll have to go there and see.
I was just trying to see if i did something wrong in iptables rules.

Thanks
 
  


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
Wireless LAN's with SuSE seanlinux Linux - Distributions 10 06-14-2006 09:24 PM
[IPTABLES] open ext access to web server on GW server kozaki Linux - Networking 3 08-27-2005 05:11 PM
DHCP server with MAC authentication on different V-LAN'S wesleywestervel Linux - Networking 1 03-24-2005 12:17 PM
iptables and connecting to exterior ftp from behind hardware router mdkelly Linux - Networking 1 07-14-2004 04:06 PM
!building a tunnel between two LAN's telephones pudhiyavan Linux - Networking 0 06-15-2004 02:31 AM

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

All times are GMT -5. The time now is 01:56 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration