Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

subnetting question


  • Please log in to reply
6 replies to this topic

#1 Man_or_Astroman

Man_or_Astroman

  • Members
  • 27 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:US
  • Local time:12:01 AM

Posted 15 May 2010 - 04:05 AM

Say I subnet a class C address on my LAN (behind an NAT router). I start out with a network ID of 192.168.4.0 /24

and made two more networks out of that, using network IDs of 192.168.4.32 and 192.168.4.64

So now I have 3 subnets, and say 5 computers on each subnet.


If I enter static addresses into each computer, what address would I give the default gateway ?




Can I give it an address belonging to any one of the three subnets ?

Let me put it another way. Do routers allow you to enter multiple gateway addresses, for each subnet ?

Edited by Man_or_Astroman, 15 May 2010 - 04:08 AM.

Do your part and SANITIZE. Keep your computer virus-free.

BC AdBot (Login to Remove)

 


#2 Orecomm

Orecomm

  • Members
  • 266 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Roseburg, Oregon
  • Local time:12:01 AM

Posted 15 May 2010 - 09:51 PM

Most commercial home routers don't support multiple subnets on the LAN side. To subnet your 192.168.4.x network you would need another multi-port router or software (like OpenWRT) on your existing router that allows you to define multiple addresses (usually on different ports or VLANs) on the LAN side. The gateway address must be on the same subnet as the host (although some implementations don't always enforce this rule oddness will occur if you ignore it, because subnet broadcasts will be on the all-zeros and all-ones of each defined subnet which will confuse the heck out of things if you have multiple masks on the same physical subnet). Thus your router needs an address on each subnet it supports, and that address would be the gateway for all systems on that subnet.

#3 Man_or_Astroman

Man_or_Astroman
  • Topic Starter

  • Members
  • 27 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:US
  • Local time:12:01 AM

Posted 16 May 2010 - 02:42 AM

hey thanks for that info.

What exactly do you mean by having multiple subnet masks on the same subnet ? Are you saying that if you statically assign different masks on hosts without defining the correct default gateway for each, problems will occur ? ? If so, that makes sense.


How exactly does OpenWRT work ? Can you install it on your computer, and use it like a virtual router ?... if that makes any sense.. :thumbsup:

Edited by Man_or_Astroman, 16 May 2010 - 02:53 AM.

Do your part and SANITIZE. Keep your computer virus-free.

#4 Baltboy

Baltboy

    Bleepin' Flame Head


  • Members
  • 1,432 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Pennsylvania
  • Local time:03:01 AM

Posted 18 May 2010 - 12:00 PM

Subnetting a class C address is done by varing the subnet mask not by changing the IP address. the floowing is a standard class c set up:
192.168.1.0
255.255.255.0

This leaves one network with 254 hosts. A subnetted class C would be

192.168.1.0
255.255.255.240

This subnets the class C into 14 networks with 14 hosts per network. Note the only difference is the change of the subnet mask. Using formula I will not get into since you can search them at your leisure you would determine the IP numbers for the hosts in each network.

Each one of these networks is know as a Subnet . All of the IP addresses for every host in the Subnet must fall within the defined limits of the network due to the subnet, including the default gateway.

The main reason for subnetting, unless your an ISP or other extra large corporation, is to create smaller isolated networks within your organization. The multiple subnets created by doing this cannot communicate without the help of a router to connect the subnets.
Get your facts first, then you can distort them as you please.
Mark Twain

#5 Man_or_Astroman

Man_or_Astroman
  • Topic Starter

  • Members
  • 27 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:US
  • Local time:12:01 AM

Posted 18 May 2010 - 05:18 PM

I know how to subnet... I simply did not show the process by which I came up with the new subnetworks.
Do your part and SANITIZE. Keep your computer virus-free.

#6 Orecomm

Orecomm

  • Members
  • 266 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Roseburg, Oregon
  • Local time:12:01 AM

Posted 19 May 2010 - 12:21 AM

Man_o_A,

This may be a bit basic, if so I apologize, I just don't know how much background you have in this stuff.

An IP subnet is defined as a subset of the entire IP network address space, the 32 bit address we usually write as four decimal numbers, each representing an 8 bit value from 0-255, separated by periods. Originally there were three defined network subsets, known as Class A, B, and C. Class A networks have 8 bits of Network address and 24 bits of Host addresses, while Class B nets have 16 of each, and Class C have 24 bits of Network address and only 8 of Host address. This meant that a Class A network could have a whopping 16 Million 777 thousand and change nodes, while a Class C was limited to 255. This system was simple to process but not very flexible. Modern "classless" subnets can appear in almost any combination of network and host bits. There are lots of references out there that will explain all this in excruciating detail.

There are a couple of important things to note. One is that each subnet has one special host address, the "all 1's" broadcast address which is the highest address in a given subnet. This address is used to communicate with all hosts within the subnet and is used by some pretty important things, like DHCP and RIP router communications. Some older systems used an "all 0's" address for broadcast, but that practice has pretty well died out. If you define multiple overlapping subnets, by changing the mask without paying close attention to the addresses used, these broadcast addresses end up in funny places and oddness occurs.

A second thing to note, and the important one in your case, is that the only way to communicate between subnets is through a router. A router is a host on multiple subnets and knows how to forward packets between them. It does not pass broadcasts (except in a couple of unusual situations) at either the IP or Ethernet levels. In your case you created three subnetworks, but you only have one router address. Some routers, like most Ciscos, can have multiple IP addresses defined on the same physical port (known as Secondary Addresses) and will route between these logical instances, but most home routers don't have that capability. Most devices, like Windows boxen, will complain if you try to define a gateway address that is not within your own defined subnet. Since only one of your subnets has a router attached, the other two don't communicate outside of their own little address spaces.

Now we will throw one more little kink in the works. A key protocol used by IP networks running over Ethernet is ARP, the Address Resolution Protocol. This protocol resolves an IP address to an Ethernet MAC address. All actual communication within a subnet occurs using Ethernet addresses, not IP addresses, and ARP "looks up" the IP address to MAC (Ethernet) address mapping by broadcasting a request for "who has IP address x.x.x.x" and expecting the owner to reply with a MAC address. ARP uses not the IP broadcast but the Ethernet "All 1's" address at the MAC level to broadcast it's requests. Now in your situation if the IP stack were poorly implemented (and a lot of them have been in the past) and did not require the gateway to be within the local subnet the curious thing is that it would actually work. Since all of your subnets are sharing one physical Ethernet network an ARP would get a reply from any node on any of the subnets, including from the router. Communication would then happen using MAC addresses, which could care less what your IP subnet plan is, as it only cares about Ethernet connectivity. This peculiarity was a major source of issues with early VLANs where it caused information to "leak" between subnets and VLANs. Unfortunately (for you) most modern IP stacks are pretty careful about this part of the implementation and won't ARP for any address outside the nodes own IP subnet.

As for OpenWRT, it is firmware for many kinds of home wireless routers that replaces the manufacturer's firmware with much more flexible, advanced, and complex software. It allows you to use many functions unavailable on stock routers, as well as the ability to misconfigure to your hearts delight or even convert your router to a "brick". Check out OpenWrt.org for more info, and be sure to read the Wiki for your specific router before trying to install it. It isn't for the casual home user, but with a little effort you can greatly expand the usefulness of your itty bitty router by adding big router functions. In your case, you can make each of the four ports on the back of your router a separate subnet, complete with it's own gateway address.

Baltboy:
Just to clarify your example, you didn't create 14 subnets of 14 hosts, you created one subnet of 16 host addresses, 192.168.1.0 through 192.168.1.15, of which two ( dot 0 and dot 15) are reserved for broadcast addresses. Other subnets can be defined with different masks out of the same base address, for instance 192.168.1.128 mask 255.255.255.128 (or /25) would define another portion of the base network but containing 128 host addresses (with two reserved) from dot 128 to dot 255. Different masks can coexist as long as you are careful not to overlap them and keep them on the binary boundaries.

#7 Man_or_Astroman

Man_or_Astroman
  • Topic Starter

  • Members
  • 27 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:US
  • Local time:12:01 AM

Posted 19 May 2010 - 03:03 AM

thx for the info. on openWRT It looks like my gateway is not supported by it :thumbsup:

It would have been fun to mess with..


thx for the clarification on the other stuff..
Do your part and SANITIZE. Keep your computer virus-free.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users