LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 09-22-2010, 01:39 PM   #1
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-15.0 / slarm64-current
Posts: 780
Blog Entries: 1

Rep: Reputation: 432Reputation: 432Reputation: 432Reputation: 432Reputation: 432
how to express range of ip addresses


I do not currently fully understand relationship between binary numbers and ip addresses and subnet addresses; nor am I asking for an explanation here at LQ, when there are plenty at wikipedia and other places...

Even after reading the wikipedia article on it, I still don't grasp it completely, so I was hoping that someone who grasps it in its entirety could answer a simple question.

How can I express the range of ip addresses from 172.22.22.200 - 172.22.22.230 ?

I was trying to make a rule for iptables that only did nat on that specific range of ips, and when i tried used the "-s" flag followed by 172.22.22.200/11 it always changes to 172.0.0.0/11 in the actual rule that is created and displayed by iptables -t nat -L.

I already have many hosts defined on my network, and rather than going through each one and changing its ipaddress to 172.0.0.#, I was hoping to learn a way to represent them in the iptables rule.
 
Old 09-22-2010, 01:48 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
http://www.subnet-calculator.com/cidr.php

Quote:
it always changes to 172.0.0.0/11
Which is correct. An /11 is very big.

200 and 230 are odd. The best you can get is 172.22.22.200/26 which is 172.22.22.192-172.22.22.255, or 172.22.22.200/29 and 172.22.22.208/29 and 172.22.22.216/29 and 172.22.22.224/29.
 
1 members found this post helpful.
Old 09-24-2010, 12:08 PM   #3
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-15.0 / slarm64-current
Posts: 780

Original Poster
Blog Entries: 1

Rep: Reputation: 432Reputation: 432Reputation: 432Reputation: 432Reputation: 432
Thankyou AlucardZero. The 172.22.22.192/26 works well for my needs, and saves me having to reassign many of the static ips on my LAN.
 
  


Reply



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
[SOLVED] What are short range link and long range links in routing? mq15 Linux - Networking 6 06-26-2009 11:16 PM
range of addresses in squid meetpsm Linux - Newbie 1 01-27-2009 01:02 AM
H V Frequency over range on Solaris Express frankoko Solaris / OpenSolaris 6 09-05-2007 02:06 AM
mechanics of mapping process memory addresses to physical addresses on amd64 Tischbein Linux - Kernel 2 02-01-2007 08:09 PM
Ping ip range to find live ip addresses? ginda Linux - Networking 2 07-16-2005 09:58 PM

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

All times are GMT -5. The time now is 05:47 AM.

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
Open Source Consulting | Domain Registration