LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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
 
LinkBack Search this Thread
Old 04-10-2007, 06:00 AM   #1
nosbod
LQ Newbie
 
Registered: Jul 2005
Posts: 18

Rep: Reputation: 0
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
 
Old 04-11-2007, 10:57 AM   #2
Buto
Member
 
Registered: Sep 2004
Location: So Cal
Distribution: Slackware 12
Posts: 60

Rep: Reputation: 16
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.
 
Old 04-11-2007, 01:02 PM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,344

Rep: Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945
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.
 
Old 04-12-2007, 03:46 AM   #4
graciejj_82
Member
 
Registered: Feb 2006
Distribution: Fedora 2
Posts: 63

Rep: Reputation: 15
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.
 
Old 04-13-2007, 08:23 AM   #5
nosbod
LQ Newbie
 
Registered: Jul 2005
Posts: 18

Original Poster
Rep: Reputation: 0
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
 
Old 04-13-2007, 02:43 PM   #6
BotKeeper
LQ Newbie
 
Registered: Aug 2006
Posts: 17

Rep: Reputation: 0
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
 
Old 04-14-2007, 12:30 AM   #7
graciejj_82
Member
 
Registered: Feb 2006
Distribution: Fedora 2
Posts: 63

Rep: Reputation: 15
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.
 
Old 04-14-2007, 01:11 AM   #8
apu132
LQ Newbie
 
Registered: Apr 2007
Posts: 1

Rep: Reputation: 0
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
 
Old 04-14-2007, 01:16 AM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,344

Rep: Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945
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.
 
Old 04-15-2007, 09:12 PM   #10
graciejj_82
Member
 
Registered: Feb 2006
Distribution: Fedora 2
Posts: 63

Rep: Reputation: 15
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)
 
Old 04-18-2007, 05:08 AM   #11
nosbod
LQ Newbie
 
Registered: Jul 2005
Posts: 18

Original Poster
Rep: Reputation: 0
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Routing between two subnets ScottReed Linux - Networking 22 10-24-2006 10:32 PM
help on subnets HappyGilmore Linux - Networking 12 07-07-2005 09:33 AM
thread switch results in kernel stack switch superstition Linux - General 1 05-17-2005 11:48 PM
set up DSL thru SWITCH - winXp connected to SWITCH too husz Linux - Newbie 5 04-22-2004 12:08 AM
Connect two subnets dzho002 Linux - Networking 5 12-02-2003 08:50 PM


All times are GMT -5. The time now is 07:49 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration