LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 07-06-2007, 06:50 PM   #1
Millenniumman
Member
 
Registered: Apr 2006
Posts: 81

Rep: Reputation: 15
Configuring router and switch


I have a router and switch, but I am unsure of how to configure them properly. Numerous attempts have failed. I want all local traffic to go through the switch, rather than the router. I would like to be able to use dhcp and static ips. From what I understand, if I set the router to be the dhcp server, then everything will go through it, which is undesirable. Is this true?

Setting the switch to run a dhcp server doesn't seem to work. It is an SMC GS24CSMART. Does that have a DHCP server?

If the switch is setting the ips, how should the router's be set, and how can it be done such that the internet works seemlessly? If the router is setting them, how should the switch's be set, and how should all local traffic be restricted to the switch?
 
Old 07-06-2007, 08:49 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
I will have to experiment on my stuff. But I would think if both machines is connected to the switch then it should only bounce between the two ports and not send the same data to all ports like in a hub device.

Quick glance of docs on SMC site does not mention DHCP in this device.

I think what is going on is the machines have a define gateway which is the routers lan IP. So to get from one to the other it must go through the router. Which is where I can see your issue if machines are gig ports and router only supports 100mb max.

Since using dhcp I see no way around that. But a thought is maybe assign the lan machines a static IP and netmask and DNS IP but no gateway. This may work but doubt things like web browsers will. If all you need is to transfer data then define IP on each and for gateway point to the other machine. I know a lousing idea.

If it is a speed issue then my only thought is get a router with 1 gigabit port. or build a linux based router with 1 gig nic and run dhcpd server on it.

Brian
 
Old 07-07-2007, 08:53 AM   #3
fatzeus
Member
 
Registered: Nov 2004
Location: Venice, Italy
Distribution: Gentoo
Posts: 44

Rep: Reputation: 15
That is very strange. In a typical setup the router could be the DHCP server and the default gateway. All the machines have an internal Ip address and the Ip of the router as Default Gateway. Default means that they send packets to the router only if the must contact an address outside the LAN (looking at the netmask). Are you sure if you have a comunication between tow machines in the LAN, the packets go through the router??
 
Old 07-07-2007, 10:25 AM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
It is an SMC GS24CSMART. Does that have a DHCP server?
No, it doesn't, and it doesn't need one.
As I understand it (and I can be a complete simpleton!) it works something like this:
[And, Yes, TCPIP-gurus, it is a little more complicated than this, but I'm not about to write a book / the definitive reference here!]

You plug your ethernet cable (from your modem / router / gateway / whatever) into your switch.
You plug your PCs into the switch. The switch will "learn them" (eg 192.168.2.5 is plugged into port 14 [Note, in this context "port" refers to the little, commonly black hole you plug an ethernet cable into]), if you move things around, the switch will adapt to the new addresses.

Suppose you now plug in a PC to port 15. This PC needs to get an address by dhcp. So it issues a dhcp request. The switch will send this request to all its connected ports. If the only dhcp server you have running is on your router, then your router will reply to the switch. The switch knows which port the dhcp request came in on, so it sends the router's reply to port 15, and that PC gets its IP address (let's say it gets address 192.168.2.200), and the switch remembers it.

Now suppose 192.168.2.5 wants to send a packet to 192.168.2.200
192.168.2.5 sends the packet to the switch. The switch looks at it, and sees that it is destined for 192.168.2.200, which it knows is connected to port 15, so it sends it out to that port, and 192.168.2.200 receives it. Your router/gateway never even sees this packet, because the switch already knew where to send it on your LAN.

Internet bound packets get sent by the switch to your router/gateway, which sends them off to the Big Bad Web, while cleverly remembering which LAN IP (192.168.2.200 in this example) made the request. The replies come back to the router/gateway with a header along the lines of "Router, this packet is for you". The router looks at the packet, and realises that 192.168.2.200 requested it, the router sends the packet to the switch, along with the information that 192.168.2.200 requested it. The switch looks at the packet, and sees it is destined for 192.168.2.200, so it sends it out on port 15, and the PC receives the reply it was waiting for.

So, the only time traffic goes to your router is when a dhcp request is made, or there are packets to, or from, somewhere outside your LAN. The rest, the switch handles. They are useful pieces of kit.
Yours looks smart. Here's its page:
http://www.smc.com/index.cfm?event=v...id=39&pid=1551

HTH
 
  


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
Network Switch or Router? rat General 6 02-19-2006 07:42 AM
Can I connect a switch to a router? glenn69 Linux - Networking 6 10-20-2004 06:27 PM
diff router and switch wincrk Linux - Networking 2 03-05-2003 08:16 PM
>1 router, one switch glj Linux - Networking 4 10-01-2002 02:32 PM
>1 router, one switch glj Linux - Networking 3 09-30-2002 03:25 PM

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

All times are GMT -5. The time now is 05:35 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