The way a network works is like this:
You have internet coming from your wall through a phoneline or cable, etc. Attached is a device called a modem which has a network plug with internet and an IP address.
Your ISP hands out this IP address, and they will only give you one unless you pay a lot. But this is not a problem, you usually only need one. But for more than one computer to connect to the internet, you need to do two things.
- Create a network for all the comoputers so they can communicate with eachother
- Bridge your network with the internet.
Using a device called a Router, you can bridge a WAN (
Wide Area Network, also known as the internet) with a LAN (
Local area network)
PC's in a network will talk to eachother by sending out and receiving data through the network cable. Basically, it sends out its data, and whomever receives it will determine if it can use it or not. By placing pc's in the same IP address range, and by using a subnet mask, you can create groups of pc's making sure some pc's can talk with eachother, where others cannot.
A switch will basically control how the data from one pc is handled to the other. By default the data is sent to all pc's until 2 pc's seem to like eachother and start talking. The switch will then connect these 2 as favorites.
This basically means, that it doesn't matter how you connect your pc's to one or more switches. It only matters how the IP assignments are set. They'll find eachother because thats what switches do for you.
So the only thing you need to do is somewhere connect the router to the switch or switches and it will work.
Just make sure the internet is connected to the WAN, and the rest of the network to the internal switch to one or more ports. So your bottom image will definitely work.
Ideally, taken your first image, I would connect it as follows:
Internet -> Router -> Port1: Switch 1, Port2: Switch 2.
Switch 1: all pc's on building 1
Switch 2 in building 2: all pc's there.
In building 2, don't use the router though. You can setup the WAN to setup as a fake ip, and not connect the WAN port at all for it to still use the wireless functionality (basically you turn it into an Access Point). You can also still use the WAN port, but know that any device on the router will then not be able to talk to other pc's on the network. They're isolated from the rest of the network, including all wireless devices.