Network router and switch configuration

4

2

Can I put a switch before my router in my home network?

Here is a diagram of how I want to set up my network:

╔═════════════════════════════════╗  ╔═════════════════════════════════════════╗
║       Cable Access Panel        ║  ║              Home Office                ║
║ ┌─────────────┐   ┌──────────┐  ║  ║   ┌─────────────────────┐               ║
║ │ Cable Modem ├──►│  Switch  ├──╫──╫──►│        Router       │___┌─────────┐ ║
║ └─────────────┘   └─┬──────┬─┘  ║  ║   └─┬────────┬────────┬─┘   │ Printer │ ║
╚═════════════════════╪══════╪════╝  ║     │        │        │     └─────────┘ ║
                   ┌──┴──┐┌──┴──┐    ║ ┌───┴─┐ ┌────┴────┐ ┌─┴───┐             ║
                   │ PC1 ││ PC2 │    ║ │ PC3 │ │ Ext. HD │ │ PC4 │             ║
                   └─────┘└─────┘    ║ └─────┘ └─────────┘ └─────┘             ║
                                     ╚═════════════════════════════════════════╝

The reason I want to do this is because my router is also my wireless access point. My cable modem is located in the far corner of my home where my phone/tv/network access panel is. I'd rather keep the wireless access point in a more central location, but I'm not sure if DHCP will continue to work properly with that configuration.

Edit: I'd like to continue to be able to share files and access my networked drive and printer from each computer in the house.

gilly3

Posted 2011-02-28T20:50:42.507

Reputation: 606

Answers

2

DHCP will not work properly, but it isn't the DHCP between your router and the machines behind your router that won't work, it's the DHCP between your ISP and your router.

Assume you aren't trying to stick a switch in the middle like that. Your router gets a public IP via DHCP from your ISP, on its WAN interface. Your router is also running it's own DHCP server, and handing out addresses probably on the 192.168.0.X subnet to machines connected to it, on the LAN interfaces. Read on to see why this relevant.

The first hurdle is that if your cable modem works like mine (which, since mine is a Comcast modem, is likely) it will not recognize a second machine behind it. I have to reset my cable modem any time I change what it is connected to.

THe second hurdle is that your ISP is very very unlikely, even if the cable modem did cooperate, willing to give you two public IP addresses without paying for them.

There's lots of ways to solve your problem, but since the location of the router/AP is important, it's going to be easiest in my opinion if you get a second router and place it where the switch is now, or get wifi dongles for PC1 and PC2.

LawrenceC

Posted 2011-02-28T20:50:42.507

Reputation: 63 487

3

Router will need to be configured as a bridge (no assignment of DHCP) and your modem would need to have the ability to create a network. I agree that the switch would be happier downstream of the router.

obeyObama

Posted 2011-02-28T20:50:42.507

Reputation: 31

2

It'll work, but your PC1 and PC2 won't be behind the router/firewall.


EDIT: If you want your PC1 and PC2 behind the firewall, you'll need some long cables. Your cable modem should go in the WAN port of the router, and the PCs into LAN ports.

Alternatively, you could use the switch into a LAN port, and a separate long cable for the modem and the router via the WAN port.

user3463

Posted 2011-02-28T20:50:42.507

Reputation:

1and they likely won't be able to get out to the internet – warren – 2011-02-28T21:08:49.700

Ok... so what part will work? Just LAN connections? – gilly3 – 2011-02-28T21:14:43.970

@warren - It depends how the router is plugged in. If it's on the same physical network, and it's not the external port, it may work. But you make an excellent point. – None – 2011-02-28T21:15:14.950

I've made some suggestions in my answer. – None – 2011-02-28T21:17:25.200

1

The cable modem has to be connected into a single device which connects to the internet. Either a single PC, in which case only that PC will be able to get to the internet, or to a router, in which case all the computers connected to the router would be able to get to the internet.

The connection between the router and the cable modem will be running PPPoE not TCP/IP, and so the router will not be able to communicate with computers on that side of it.

What you want to do is basically swap the router and switch over, so it goes:

cable modem -> router ------------------> switch -> pcs
                   \-----> pcs

Majenko

Posted 2011-02-28T20:50:42.507

Reputation: 29 007

You could always add a wireless repeater to increase the range of your wireless signal. – Majenko – 2011-02-28T21:30:09.223

1

Look for a good layer-2 switch that can also take over dhcp duties from the router, configure the router to run in bridge mode (or just turn off dhcp and connect your upstream cable to a normal lan port), and set up dhcp on the switch to use the same subnet as your cable modem's internal ip network address and hand out that address as the default gateway.

Joel Coehoorn

Posted 2011-02-28T20:50:42.507

Reputation: 26 787