building a router

Status
Not open for further replies.

fitzjj

Daemon Poster
Messages
544
I have myself a freeBSD box which is slowly being turned into a router, however there is one aspect that i am not too sure on:

My other routers have a WAN port and several (say 4) LAN ports. Now the WAN has an IP address and a MAC address, however the 4 LAN ports all have the same IP address and the same MAC address.

Now my freeBSD box has 4 NIC's, one set up as a WAN and currently one set up as LAN and everything works fine. Now obviously i want to get the other two LAN ports working as LAN ports. Should i go down the route of setting each with a unique IP address so that in effect each device connected to the router will see the router with a different IP address. Or do i choose a singe IP address and apply it to all three LAN ports - surely this second option will give routing issues?

A tutorials found through google only have the one LAN port which is not too much help since i can get that working fine.

Any thoughts would be lovely. Also if anyone has any experience of IPv6 routing that would be cool, at the moment everything is IPv4 but the main reason for building this router is to get some hands on experience with IPv6.

thanks
 
fitzjj said:
however the 4 LAN ports all have the same IP address and the same MAC address.

both statements in this sentence are wrong

#1 you cannot have two nodes with the same ip on the same subnet. IP addresses must be unique to be able to know which node is which. Put two nodes with the same ip and you will get errors.

#2 the hardware MAC Address for each device is unique. Same thing as with IP addresses, it allows other nodes to be able to identify which node is which.

There are hacks / setups you can implement in your OS to change the MAC address; for example cluster nodes. At this point, you're using a software MAC address and while the hardware MAC still exists, it may or may not be in use with the software MAC.



i would setup the router with two nics for two networks or subnets. Want more than two? Add another nic for each network / subnet and give it a unique ip for that subnet. If you want to connect more than one machine to the router, use a hub or switch inbetween the router and your client nodes.
 
Yes, i see now! Effectively a 4port router is the same as a 1port router with a 4port switch plugged into it. Since switches are transparent the switch part is not addressable hence why everything plugged into any port sees the router at the same IP address and MAC address.

My confusion has come from the fact that i am aware MAC's are unique and duplicate IP addresses will screw the network up, which is why the statement i made, that csamules points out is incorrect on both points, led me to this confusion. Effectively what i was trying to do was build a router and a switch.

Therefore i will need to use 3 different subnets in order to make use of the 3 NICs, if i want more than 1 machine on each of the subnets i will need to plug them into a switch.

All has come pretty clear now.
 
Status
Not open for further replies.
Back
Top Bottom