LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   2 subnets through one switch (https://www.linuxquestions.org/questions/linux-networking-3/2-subnets-through-one-switch-544768/)

nosbod 04-10-2007 06:00 AM

2 subnets through one switch
 
Hi,
is it possible to have 2 networks connected through one switch?

ie 192.168.2.x and 192.168.1.y

Would i need to set the switch up as a vlan?

cheers

Buto 04-11-2007 10:57 AM

I have tried it once and it worked. You should give it a try and see if it gives you an errors. But if it's a long term solution the best thing to do is VLAN them.

acid_kewpie 04-11-2007 01:02 PM

a vlan is the technically correct way of doing it, but there's no reason at all it wouldn't work fine without them, just not a nice way to do it.

graciejj_82 04-12-2007 03:46 AM

The problem I see you running into is that unless you're running a commercial router, such as a cisco, or the like, OR running a linux box as you're router, you'll be limited to the configurability of the router.

You'll need to be able to setup youre router to serve as the default gateway to both subnets. And i don't think you can do this with a standard, home broadband router. Let us know what your setup is, i'm curious to how you're going to make this work out. Keep us informed.

nosbod 04-13-2007 08:23 AM

thanks for the help.

i have a linux box which is the default gateway. It is on the 192.168.1 subnet and is connected to the internet on its second card. That's all fine

On my lan I have a rack full of machines. All machines in this rack are connected by 2 switches and reside on the 192.168.2 subnet. One of the machine however is also connected to the 192.168.1 subnet via a wall mounted port. The switches that are connected together are Dell power connect 2608 and D-Link 1024.

Now, this is where the problem starts. I want to add another machine to the rack but i want it to be on the 192.168.1 subnet. I don't have any more wall mounted ports available to plug this into the 192.168.1 subnet. Temporarliy I have put another switch into this wall mounted port, but i don't want it to be permanent.
so, my plan was to take a cable from the wall mounted port on the 192.168.1 subnet into one of the switches holding the 192.168.2 subnet together and then plug both rack mounted machines that need to be on the 192.168.1 subnet into the switch as well.
This means that the 192.168.2 and 192.168.1 subnets are sharing switches. It also means that one of my rack mounted machines is connected to the same switch with bot of it's network cards. Sorry, i know this is a bit confusing! I'll put up a jpg if it doesn't make sense

cheers

BotKeeper 04-13-2007 02:43 PM

Most switches, both dumb and managed do not care about the IP addresses in any of the packets. This lack of interest is what enables a switch to carry other than IP packets (e.g., DecNet, AppleTalk). Rather, switches generally operate only on MAC addresses. So, you can easily carry two subnets through one switch. We do this at our office.

It is OK to connect the one machine with two LAN cards (one for each subnet) to the same switch with two cables. You can have the same effect by using only one LAN card and configuring two network addresses:
Code:

ifconfig eth0 192.168.1.30 netmask 255.255.255.0 broadcast 192.168.1.255
Code:

ifconfig eth0:0 192.168.2.45 netmask 255.255.255.0 broadcast 192.168.2.255
The drawbacks of two subnets on one LAN include
  • Both subnets are competing for bandwidth.
  • A machine on one subnet can see traffic for the other subnet (when in promiscuous mode). This can lead to security risks, especially with DMZs

graciejj_82 04-14-2007 12:30 AM

Quote:

Originally Posted by BotKeeper
The drawbacks of two subnets on one LAN include
  • Both subnets are competing for bandwidth.
  • A machine on one subnet can see traffic for the other subnet (when in promiscuous mode). This can lead to security risks, especially with DMZs

This would be no different than just having one subnet. Except that the sniffer would have to sniff accross subnets, which is more difficult because you have to actually fool the router/gateway into sending the packets to the machine doing the sniffing. On a single subnet network, you just have to fool the switches.

I would concider 2 subnets more secure if there is sensitive traffic on one of the networks.

Just my opinion.

apu132 04-14-2007 01:11 AM

Hello dears,

would any one help me that how do i make VLAN on cisco or any other's switche. How would i benifited by doing the above..

wait to have a responce from my brother's

N>B: I am new in linux ..so don't be bore after read my question

apu

acid_kewpie 04-14-2007 01:16 AM

that is upto your switch, and it's associated documentation... we can't help you with that from the linux side.

also please don't ask questions in other peoples threads. if you have your own questions, start your own threads.

graciejj_82 04-15-2007 09:12 PM

Quote:

Originally Posted by apu132
Hello dears,

would any one help me that how do i make VLAN on cisco or any other's switche. How would i benifited by doing the above..

wait to have a responce from my brother's

N>B: I am new in linux ..so don't be bore after read my question

apu

I am currently taking classes to aquire Cisco CCNA certification. If you'll email me with the plans of what you want to do, I can help you with the VLANs. Just make sure you can setup VLAN/Subinterfaces on the gateway. I know how to do this on Cisco routers, but if you're running a linux box as your router, I hope you know how to do it. Or we can figure it out together.

Anyways, my email address is m.mixon (at) yahoo (dot com)

nosbod 04-18-2007 05:08 AM

Hi,

well it all worked fine. both subnets going through a couple of switches, with one machine connected to the same switch via 2 cards on 2 different subnets. The reason I asked this question in the first place was because I did initially give it a go without success.
The reason being that it didn't seem to be working with my D-Link 1024 switch. It does seem to work with my Dell power connect 2608 switch however. I'm not completely sure why this might be.

Anyway, thanks for the help


All times are GMT -5. The time now is 01:57 AM.