Networking Forums

Networking Forums > Computer Networking > Linux Networking > iptables - Open all ports between 3 ips

Reply
Thread Tools Display Modes

iptables - Open all ports between 3 ips

 
 
Gerhard Haslberger
Guest
Posts: n/a

 
      05-09-2009, 02:39 PM
Hi,

im searching and searching.... but..

Can someone give me a hint?

I want to open all ports between 5 IPs (5 Servers - totally different
ips) but just between them.

Is it possible to do that without create a rule for every ip to ip pair?
Something very easy or at least:

-s 1.1.1.1,2.2.2.2,3.3.3.3... --sport 1:65535
-d 1.1.1.1,2.2.2.2,3.3.3.3... --dport 1:65535

How? or any keyword-hits for google?

Thanx
 
Reply With Quote
 
 
 
 
Chris Davies
Guest
Posts: n/a

 
      05-09-2009, 03:35 PM
Gerhard Haslberger <(E-Mail Removed)> wrote:
> I want to open all ports between 5 IPs (5 Servers - totally different
> ips) but just between them.


> Is it possible to do that without create a rule for every ip to ip pair?


What's your network topology (i.e. where are the servers in relation to
your firewall)?

A,B,C -- firewall -- D,E

A -- firewall -- B,C,D,E

A -- firewall -- B
| | |
C D E

etc.
Chris
 
Reply With Quote
 
Gerhard Haslberger
Guest
Posts: n/a

 
      05-09-2009, 04:10 PM

Web -- port 80 -- ( LoadBalancer (on A) distributes vom A-E)

A - E should have Access to all ports from each other (they share nfs,
myslq ...)

A should also open port 80 (in this example)

Better shown like this:


Web
|
port 80
|
Loadbalancer on A
|||||
ABCDE

------
I know how to do it in MANY-iptable-Code-Lines, but is it possible to
use only a few for the A-E pool to open all ports inside this pool?
Remember that A-E has different ips bec there are hosted in different
Datacenters
 
Reply With Quote
 
Gerhard Haslberger
Guest
Posts: n/a

 
      05-09-2009, 04:43 PM
> Web
> |
> port 80
> |
> Loadbalancer on A
> |||||
> ABCDE


and right now i say

A -> B
<-> C
<-> D
<-> E

B <-> A
<-> C
<-> D
<-> E


and so on for specific ports ....

but iam looking for one "Line" which i can copy to all servers which
enables all communications within a given ip-pool

 
Reply With Quote
 
Chris Davies
Guest
Posts: n/a

 
      05-09-2009, 07:03 PM
Gerhard Haslberger <(E-Mail Removed)> wrote:

> Web -- port 80 -- ( LoadBalancer (on A) distributes vom A-E)


> A - E should have Access to all ports from each other (they share nfs,
> myslq ...)


Strikes me that one way to do this is as follows. Put two NICs
in A and one in each of B-E. Create an unroutable private subnet
(e.g. 192.168.0.0/24) that encompasses all of A-E. (If necessary make
them secondary IP addresses on each of the NICs.) Use this subnet to
route between A,B,C,D,E. Allow the entire subnet on the back-end NIC
for A (one or two iptables rules). Disallow it on the front side (two
rules). Allow inbound requests to A from everywhere (one rule).

Chris
 
Reply With Quote
 
Antoine EMERIT
Guest
Posts: n/a

 
      06-01-2009, 05:55 PM
Gerhard Haslberger <(E-Mail Removed)> écrivait
news:gu44j0$n0b$(E-Mail Removed):

> Hi,
>
> im searching and searching.... but..
>
> Can someone give me a hint?
>
> I want to open all ports between 5 IPs (5 Servers - totally different
> ips) but just between them.
>
> Is it possible to do that without create a rule for every ip to ip
> pair? Something very easy or at least:
>
> -s 1.1.1.1,2.2.2.2,3.3.3.3... --sport 1:65535
> -d 1.1.1.1,2.2.2.2,3.3.3.3... --dport 1:65535
>
> How? or any keyword-hits for google?
>
> Thanx


Did you try the iptables 'iprange' module :

http://iptables-tutorial.frozentux.n...bles.html#lbBC ?


Regards
 
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
How do I open all my ports?? J Lunis Wireless Networks 5 09-24-2006 04:09 AM
open ports Raul Network Routers 1 05-20-2005 07:35 PM
Open ports for two IPs Joerg Reutershan Network Routers 2 03-13-2005 03:00 AM
Can't open two of the same ports Chris Broadband Hardware 5 08-01-2004 03:38 AM
MN 700 Ports open Bill G Broadband Hardware 4 04-15-2004 02:23 AM



1 2 3 4 5 6 7 8 9 10 11