LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Help connecting two Lan's on same server with IPTABLES (https://www.linuxquestions.org/questions/linux-networking-3/help-connecting-two-lans-on-same-server-with-iptables-213834/)

cipx2 08-05-2004 12:18 PM

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

Charalambos 08-05-2004 02:58 PM

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?

cipx2 08-05-2004 05:36 PM

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

cipx2 08-05-2004 05:40 PM

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

PiLgRiM 08-05-2004 07:47 PM

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

cipx2 08-06-2004 02:14 AM

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

Demonbane 08-06-2004 02:54 AM

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?

cipx2 08-06-2004 05:02 AM

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


All times are GMT -5. The time now is 08:41 AM.