Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Firstly: What is the difference between a bridge and a switch?
Second: If I wanted to turn a linux box into a four port switch - how would I go about doing it. Do I need to give each network interface an IP address? - do any of the cards need to have IP addresses come to think of it.
Third: I have router with four ethernet ports on. Could someone explain how the router is set up. It has and internet LAN IP address and an external WAN IP address, but what addresses would the ethernet ports have?
A bridge is a device that connects network segments together. The network segments will be on different subnets. For a computer to connect another computer on a different subnet, the traffic goes through a bridge. A bridge may also connect an ethernet to a token-ring network.
A switch is similar to a hub. A switch will however make a dedicated connection between to ports. It will also store a packet before sending it. This will allow full duplex modes, and also a 10baseT NIC can connect to a 100baseT NIC, and the 100baseT NIC doesn't have to drop down speed.
Just buy a switch. A 5-port switch will only cost around $30.
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
You can buy 2-port and 4-port hub PCI cards, and also dual and quad NICs as well. I'm not sure if there are any PCI switch cards, but I imagine there are if you look hard enough.
Turning a PC into a switch would be fairly difficult, since you would need multiple network cards that are all on the same subnet. I'm not sure that the level of complication would really be worth it. What are you trying to achieve with a PC-as-switch that you could not just buy from eBay?
Oh, and routers that have multiple ethernet ports are generally just routers with embedded switches. Each of the ethernet ports may have an IP on the LAN subnet (but usually you can't assign different ports to different subnets).
I basically want to do some expreimenting with layer two devices.
I understand how hubs work and switches to a degree - but they don't have IP addresses. This is what confuses me becuase I always associate a NIC with having an IP address.
My router for example. If I wanted to set up a linux box as a 4-port router then each interface would have a different mac address - but would they all need to have the same IP address??
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.