0

I'm playing with the idea of turning an old router which lying around in to a switch and attaching this to my current router. It's not so much because I need the extra ports, mainly because I am quite new to networking and want to have a play around.

I've seen a few tutorials on the internet which seem pretty straight forward - basically disable DHCP and you're practically good to go.

My main question is, how do the IPs get assigned to the devices attached to the switch if the switch has no DHCP facility? How does the router 'know where these devices are?'

When you connect the switch to the router, does the switch make note of this being the Default Gateway and also store the port this gateway is attached to? Do the connected devices then automatically pass straight through the switch to the router to get their IPs assigned? Then any data that needs to go to these extra devices, does this just get passed to the switch and that does a NAT like procedure passing on to MAC addresses?

I know this is probably very basic, but once I've got my head around this bit of detail it will help me a great deal when I come to setting this up.

Thanks in advance and all the best.

2 Answers 2

0

Without knowing the make/model of the router, I can only assume turning off DHCP in this case will allow it to be a dummy switch, in which case anything you connect to it will get their IP addresses via the router your switch is now connected to.

The switch should then be invisible to the network, with devices connected to them simply acting like they are connected back to the router, and thus the rest of the network. The caveat being that the connected devices will share that single link back to your router, and thus your WAN (internet) and anything else connected directly to your router. In most cases this isn't an issue if you're using gigabit ports and plan your bandwidth usage accordingly.

0

Switches work at layer 2 in the OSI model, with MAC addresses - they have no concept of IP addresses (you do have layer 3 switches/routers, but that's not your question). DHCP works on a broadcast basis, and a switch will forward these packets to all ports/machines. You only need (and should only have!) one DHCP server on any given subnet.

In your case of repurposing a router, connect everything to the LAN ports, not the WAN port.

11
  • Tanks for the detailed reply. This is the main thing that is confusing me, obviously you couldn't have 4 devices plugged in to one port of a router, but in essence this is what a switch is doing. Say for example my switch is plugged in to port 4 of the router, with 4 devices attached to it. Data comes in to the router from the internet with the destination of device 2 on the switch. How does the data reach the correct destination? Normally I would assume the router would know which IP address is on which port and just forward it accordingly, but in this case there will be 4 IPs on one port?
    – JD87
    Jan 15, 2014 at 0:47
  • Switches keep a table of MAC addresses for the device connected to each port. This allows it to forward the correct packet appropriately.
    – Hefewe1zen
    Jan 15, 2014 at 1:06
  • @JD87 If the IP address is on the local subnet, the router does not come into play. ARP (again, broadcast, like DHCP is) is used to translate it into a MAC address, which it is then sent to. If the IP address is on a different subnet, it's sent via the gateway (router), which may or may not apply NAT - consumer routers typically do apply NAT.
    – Bob
    Jan 15, 2014 at 2:03
  • @Bob Ah right, I get you! So even in my home network without the additional switch, my router is only acting as a router when communicating with a different network. When communicating between attached devices it is just acting as a switch using MAC addresses. Cheers for all help, that's cleared a couple of things up for me!
    – JD87
    Jan 15, 2014 at 10:41
  • @JD87 :) Your typical consumer "router" is actually a router and a switch and sometimes a wireless access point combined in one package - but they actually serve distinct roles and are usually distinct devices in enterprise equipment.
    – Bob
    Jan 15, 2014 at 10:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .