LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-26-2011, 01:23 PM   #1
dave247
Member
 
Registered: May 2004
Posts: 206

Rep: Reputation: 30
separating networks connected through the same switch


Hey. I am working on a networking research project and trying to increase my understanding in some areas.

I have a Linux dhcp server connected to a single 24-port switch. The dhcp server is 150.50.0.1. I would like to serve ip addresses to computers in two separate rooms. One room is going to be on the 150.50.0.0 network with hosts 150.50.0.1 to 150.50.15.254 and the other room will be 150.50.16.1 to 150.50.31.254 (I know this provides more hosts than the switch can handle, but I'm not worried about that atm).

Now I am at the point where I realize that I can't simply separate the ip addresses of the computers among the two rooms unless I use static ip's associated with the mac addresses of the computers. So my question is how is this usually done? Would I have to connect the computers in each room to their own gateway device which then connects to the switch? How do I tell my dhcp server what networks each room is on?

Other thoughts: I assume I could collect the mac addresses from each room and then dynamically assign addresses to each based on the network group they are under...

thanks for any input.
 
Old 09-26-2011, 01:42 PM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
Since a switch is a layer-2 device, all the ports connected to the switch (exclusive of the uplink (if it has one) have to be on the same subnet.

Unless you have a switch that is capable of using VLANs you are going to be limited to the same subnet.

You would need a layer-3 device to have separate networks.
 
Old 09-26-2011, 02:33 PM   #3
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891

Rep: Reputation: 184Reputation: 184
Hmmm, beg to differ. Since a switch is a L2 device it is completely IP network agnostic. You can have 100 IP networks running on it if you want. Typically we configure one subnet per vlan but this is just to keep things tidy, it does not have to be the case.

Typically for what you are doing you would just leave all the devices in one subnet on the switch and run longer cables. why make things more complex than they need to be?

You could have two switches and run an uplink between them. Tidier on cabling.

If you want two subnets because you want to play with them you could place a secondary IP subnet on your server nic or on another nic, and have half the hosts use the second subnet. The server then becomes your router.
will break
If your switch supports vlans you could place the secondary subnet into another vlan, but you don't have to. You do not have a big enough network to worry about L2 separation of hosts. If you did this then your server would need to have one nic in each vlan or be configured for 802.1q vlan tagging.

If your server only has one nic and you want to keep one network on it then you could join the two subnets with a router. This could in the same way as the server be connected on one interface per vlan or on a vlan tagged interface. You would need to configure the router to forward BOOTP or your DHCP will break.

This is probably the most difficult thing about networking, there are so many ways to acheive the same thing!

Last edited by baldy3105; 09-26-2011 at 02:36 PM.
 
Old 09-26-2011, 03:10 PM   #4
dave247
Member
 
Registered: May 2004
Posts: 206

Original Poster
Rep: Reputation: 30
Thanks for the reply, Baldy.

I suppose the reason I wanted separate subnets is because I am trying to simulate a network where I allow certain things on one network that I don't on the other such as internet access -- for security reasons.

After I made the post, I got to thinking: I could get in and configure the switch so that specific groups of ports could be used for each subnet. Of course I could just use two switches instead... or a router... or install another nic in my server (one nic per subnet). However, I am trying to work with the equipment I have.

It is so true that there are many different ways to achieve the same results! It would probably be easiest to assign static ip addresses on my network. That would cut down on all this complexity.

Thanks for the input!
 
  


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
Multiple Networks On Switch kegwell Linux - Networking 4 10-08-2011 04:33 PM
Iptables + Forwarding + Vlan + OpenVPN & L2 junk switch /L3 extreme networks switch feloniousj Linux - Networking 3 03-15-2010 09:27 PM
scan for networks and stay connected wireless soleblaze Linux - Software 0 08-03-2005 06:04 AM
Method to scan for wireless networks and quickly switch between them. crozewski Linux - Wireless Networking 1 04-16-2005 11:04 AM
set up DSL thru SWITCH - winXp connected to SWITCH too husz Linux - Newbie 5 04-22-2004 12:08 AM

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

All times are GMT -5. The time now is 05:45 PM.

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