iptables and Class B IP ranges

iptables and Class B IP ranges

Post by Lup » Thu, 28 Mar 2002 12:05:32



This might have already been answered somewhere, but I have been looking
and can't seem to find an answer to this simple question.  How do you
specify a Class B ip range for iptables?  In other words:
-A INPUT -i eth0 -s 150.202.x.x -j ACCEPT
obviously it is not this:
-A INPUT -i eth0 -s 150.202.0/24.0/24 -j ACCEPT, so what is it?

tia,
Lup

 
 
 

iptables and Class B IP ranges

Post by Armin Krawinke » Thu, 28 Mar 2002 12:12:19



> This might have already been answered somewhere, but I have been looking
> and can't seem to find an answer to this simple question.  How do you
> specify a Class B ip range for iptables?  In other words:
> -A INPUT -i eth0 -s 150.202.x.x -j ACCEPT
> obviously it is not this:
> -A INPUT -i eth0 -s 150.202.0/24.0/24 -j ACCEPT, so what is it?

> tia,
> Lup

correct me if im wrong

150.202.0.0/24?

network 150.202.0.0
client  0.0.x.x

--
Rgds, Armin
Take a look at ==> http://www.dtch.org
if u have a minute or two...

 
 
 

iptables and Class B IP ranges

Post by Lup » Thu, 28 Mar 2002 12:26:17



>> This might have already been answered somewhere, but I have been
>> looking and can't seem to find an answer to this simple question.  How
>> do you specify a Class B ip range for iptables?  In other words: -A
>> INPUT -i eth0 -s 150.202.x.x -j ACCEPT obviously it is not this: -A
>> INPUT -i eth0 -s 150.202.0/24.0/24 -j ACCEPT, so what is it?

>> tia,
>> Lup

> correct me if im wrong

> 150.202.0.0/24?

> network 150.202.0.0
> client  0.0.x.x

I'm sorry, I don't understand what you are saying/asking.  Can you
explain further?
 
 
 

iptables and Class B IP ranges

Post by S C Rigl » Thu, 28 Mar 2002 12:28:42


Or should that be:

150.202.0.0/16

-S


>correct me if im wrong

>150.202.0.0/24?

>network 150.202.0.0
>client  0.0.x.x

>--
>Rgds, Armin
>Take a look at ==> http://www.dtch.org
>if u have a minute or two...

 
 
 

iptables and Class B IP ranges

Post by Ed Haggert » Thu, 28 Mar 2002 12:31:15


Try

150.202.0.0/16



> > This might have already been answered somewhere, but I have been looking
> > and can't seem to find an answer to this simple question.  How do you
> > specify a Class B ip range for iptables?  In other words:
> > -A INPUT -i eth0 -s 150.202.x.x -j ACCEPT
> > obviously it is not this:
> > -A INPUT -i eth0 -s 150.202.0/24.0/24 -j ACCEPT, so what is it?

> > tia,
> > Lup

> correct me if im wrong

> 150.202.0.0/24?

> network 150.202.0.0
> client  0.0.x.x

> --
> Rgds, Armin
> Take a look at ==> http://www.dtch.org
> if u have a minute or two...

--

Ed Haggerty
New London Computer Service Inc.
2099 Newark Rd    P.O. Box 160
New London, PA 19360
610-869-3955 (V)
610-869-7114 (F)


 
 
 

iptables and Class B IP ranges

Post by Armin Krawinke » Thu, 28 Mar 2002 13:22:15




>>> This might have already been answered somewhere, but I have been
>>> looking and can't seem to find an answer to this simple question.  How
>>> do you specify a Class B ip range for iptables?  In other words: -A
>>> INPUT -i eth0 -s 150.202.x.x -j ACCEPT obviously it is not this: -A
>>> INPUT -i eth0 -s 150.202.0/24.0/24 -j ACCEPT, so what is it?

>>> tia,
>>> Lup

>> correct me if im wrong

>> 150.202.0.0/24?

>> network 150.202.0.0
>> client  0.0.x.x

> I'm sorry, I don't understand what you are saying/asking.  Can you
> explain further?

As far as i know an IP adress consists of 2 parts. the network adress and
the host adress.

150.202.0.0/24 defines a subnet within 150.202.0.0.
the /24 means that the first 24 bits of the address are reserverd for the
definition of the network, the other 8 bits can be used to define hosts
within the network.

if u have a host with the host adress
0.0.0.1 within this network the full ip adress of the host will be

150.202.0.0
     +
000.000.0.1
     =
150.202.0.1

take a look at these sites for more detailled information about subnet
configuration:

http://public.pacbell.net/dedicated/cidr.html <== very good
http://www.cisco.com/warp/public/701/3.html
http://www.cisco.com/warp/public/105/40.html

and browse the web for cidr (Classless Inter-Domain Routing)

this is exactly what u need

--
Rgds, Armin
Take a look at ==> http://www.dtch.org
if u have a minute or two...

 
 
 

iptables and Class B IP ranges

Post by Boo » Thu, 28 Mar 2002 21:14:41


for the future, check out http://jodies.de/ipcalc

which can answer any and all questions about A's, B's, C's,
/21's, /19's and CIDR generally, with a nice newbie friendly
calculator layout.

You can even download the Perl CGI and install it own your
own server.

 
 
 

iptables and Class B IP ranges

Post by admi » Fri, 29 Mar 2002 04:08:21



>This might have already been answered somewhere, but I have been looking
>and can't seem to find an answer to this simple question.  How do you
>specify a Class B ip range for iptables?  In other words:
>-A INPUT -i eth0 -s 150.202.x.x -j ACCEPT
>obviously it is not this:
>-A INPUT -i eth0 -s 150.202.0/24.0/24 -j ACCEPT, so what is it?

>tia,
>Lup

Lup,
Use:
-A INPUT -i eth0 -s 150.202.0.0/16 -j ACCEPT

Also see http://www.telusplanet.net/public/sparkman/netcalc.htm
for your future ip calculating needs,

Cheers
mike

 
 
 

1. port knocking regarding the class C (/24) ranges with iptables?

Which is the best port knocking solution to open a local port for
incoming connection from whole C (/24) ranges with iptables?

Let's have an iptables firewall filtering connections for two public
IP addresses: 1.2.3.4 and 1.2.3.5

If an incoming connection from 9.8.7.6 comes to port 25 at 1.2.3.4, I
would like to open/unblock port 25 at 1.2.3.5 for the whole 9.8.7/24
range.

(There is some reason why I need two separate public addresses -- I
would like to try something like transparent greylisting on the
firewall -- while the ordinary spambots tend to target the primary MX
OR the secondary MX ONLY, the full-fledged SMTP host tries both MX's)

2. BASE64 encoding format

3. A second class c ip range for no extra cost

4. Diamond SpeedStar64 compatability

5. Howto set an IP address range into rules of iptables

6. Evolution card

7. iptables: block ip range

8. USB device driver

9. Class A and Class C IP Addresses on one PC help please

10. AIX box with a class B IP and class C subnet mask

11. How to exclude single ip-address form ip range?

12. Fax modems -- class 1, class 2, class 2.0 -- whats going on?

13. Second "C" class range - 1 gateway