Networking Forums

Networking Forums > Computer Networking > Linux Networking > IPTABLES question, multiple rules

Reply
Thread Tools Display Modes

IPTABLES question, multiple rules

 
 
=?ISO-8859-1?Q?Hern=E1n_Freschi?=
Guest
Posts: n/a

 
      04-21-2005, 04:07 PM
Hi, I have a question. I've set up a PPTP server with PoPToP for a VPN
server. This server will be shared among several customers, each one a
different company with many connections. So i'll have:
CLIENTS 1, 2, 3, 4 belong to company A
clients 5, 6, 7 and 8 belong to company B.

I'll assign, say, 10.10.1.1 to client 1, 10.10.1.2 to client 2, and so
on, basically 10.10.1.0/24 to company A, and 10.10.2.0/24 to company B.

All clients will connect to the same VPN server, but this server will
automatically assign the right IP address, based on the username. So, in
order to keep packets within each customer's network, I do something like:

iptables -P FORWARD DROP

iptables -A FORWARD -s 10.10.1.0/24 -d 10.10.1.0/24 -j ACCEPT
iptables -A FORWARD -s 10.10.2.0/24 -d 10.10.2.0/24 -j ACCEPT
iptables -A FORWARD -s 10.10.3.0/24 -d 10.10.3.0/24 -j ACCEPT
....


So for every company I add, I need a new rule. Is this the only way to
go, or is there an easier way to do this?


hjf

--
Sí esta atascado, fuércelo. Sí se rompe, es que necesitaba ser reemplazado.

http://www.hjf.com.ar/
hjf

--
Sí esta atascado, fuércelo. Sí se rompe, es que necesitaba ser reemplazado.

http://www.hjf.com.ar/
 
Reply With Quote
 
 
 
 
Mike Mol
Guest
Posts: n/a

 
      04-21-2005, 08:14 PM

Hernán Freschi wrote:
> Hi, I have a question. I've set up a PPTP server with PoPToP for a

VPN
> server. This server will be shared among several customers, each one

a
> different company with many connections. So i'll have:
> CLIENTS 1, 2, 3, 4 belong to company A
> clients 5, 6, 7 and 8 belong to company B.
>
> I'll assign, say, 10.10.1.1 to client 1, 10.10.1.2 to client 2, and

so
> on, basically 10.10.1.0/24 to company A, and 10.10.2.0/24 to company

B.
>
> All clients will connect to the same VPN server, but this server will


> automatically assign the right IP address, based on the username. So,

in
> order to keep packets within each customer's network, I do something

like:
>
> iptables -P FORWARD DROP
>
> iptables -A FORWARD -s 10.10.1.0/24 -d 10.10.1.0/24 -j ACCEPT
> iptables -A FORWARD -s 10.10.2.0/24 -d 10.10.2.0/24 -j ACCEPT
> iptables -A FORWARD -s 10.10.3.0/24 -d 10.10.3.0/24 -j ACCEPT
> ...
>
>
> So for every company I add, I need a new rule. Is this the only way

to
> go, or is there an easier way to do this?


Add rules for all possible clients, and leave it like that? Just track
which subnets you've assigned to who.

 
Reply With Quote
 
=?ISO-8859-1?Q?Hern=E1n_Freschi?=
Guest
Posts: n/a

 
      04-22-2005, 12:33 AM
Yes, thats how I do it, but I'm worried about performance. Every packet
arriving on the interfaces must be checked with a couple of tens of rules.

Mike Mol wrote:

> Add rules for all possible clients, and leave it like that? Just track
> which subnets you've assigned to who.
>



hjf

--
Sí esta atascado, fuércelo. Sí se rompe, es que necesitaba ser reemplazado.

http://www.hjf.com.ar/
 
Reply With Quote
 
Raqueeb Hassan
Guest
Posts: n/a

 
      04-22-2005, 02:21 AM
<snip>

> So, in order to keep packets within each customer's network, I do

something like:

>iptables -P FORWARD DROP


>iptables -A FORWARD -s 10.10.1.0/24 -d 10.10.1.0/24 -j ACCEPT
>iptables -A FORWARD -s 10.10.2.0/24 -d 10.10.2.0/24 -j ACCEPT
>iptables -A FORWARD -s 10.10.3.0/24 -d 10.10.3.0/24 -j ACCEPT

....


You are right. IMHO, I think there should be easier way to keep packets
within it's own network, have you tried denying the access of packet
from other network? Let me know.


--
Raqueeb Hassan
Bangladesh

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables question with multiple interfaces phiveohtwo@gmail.com Linux Networking 8 12-17-2007 01:48 AM
IPTables drop rules on forward but not for certain MAC's question David Linux Networking 1 06-08-2007 02:10 PM
Is there a difference between these two iptables rules paulwvanc@yahoo.ca Linux Networking 0 12-11-2006 11:21 PM
Looking for iptables applications code (iptables.c) to run some rules to forward packets tvnaidu@yahoo.com Linux Networking 2 01-17-2005 05:01 PM
iptables rules get deleted... Paul M. Linux Networking 3 06-25-2003 01:04 AM



1 2 3 4 5 6 7 8 9 10 11