LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   basic: IP and MAC addresses on routers/switches (https://www.linuxquestions.org/questions/linux-networking-3/basic-ip-and-mac-addresses-on-routers-switches-308614/)

johnMG 04-01-2005 09:29 AM

basic: IP and MAC addresses on routers/switches
 
A "hardware router" (like a Linksys WRT54g) has a number of ports (besides the "WAN" port) for me to plug computers into -- is it correct that each one of those ports has its own MAC address?

I realize that a switch is just a piece of ethernet hardware, and it doesn't know anything about IP. Is that Linksys router logically like a desktop computer with 2 ethernet ports: one port being for the WAN uplink, and the other with an ethernet switch directly attached to it?

What's the GNU/Linux tool for looking at the MAC address of various devices on the LAN?

slacky 04-01-2005 11:46 AM

FYI, a Linksys WRT54g runs Linux as the operating system. Only difference between it and a PC is hardware - the router uses a low power consuming CPU, a small amount of flash memory instead of a hard drive, etc. Linux has the bridge module you can use to bridge ethernet ports together so they act as a switch - you can buy PCI network cards that have more than one ethernet port, or you can add multiple NICs to a Linux PC and do the same thing.

The arp command shows the ip address to mac address table of devices you've recently talked to. And if you are looking to learn things, look at a packet sniffer such as tcpdump or Ethereal.

johnMG 04-01-2005 04:21 PM

Quote:

FYI, a Linksys WRT54g runs Linux as the operating system.
Right. That's why put "hardware router" in double quotes in my original post. I'm really not sure how we're supposed to refer to those things, since they're so similar to a GNU/Linux box with a couple of network cards. :)

Quote:

Linux has the bridge module you can use to bridge ethernet ports together so they act as a switch
Ahh... interesting. I've never heard of this. Any pointers on where I could find some docs about it would be most appreciated.

Quote:

- you can buy PCI network cards that have more than one ethernet port,
Double ahh! I didn't know such beasts existed. I'll have to poke around the web and look for one. I think you're telling me that you use this Linux "bridge module" either with these sorts of NIC's, or else when you install multiple cards into the same system. Or maybe even if you have both, come to think of it.

Quote:

The arp command shows the ip address to mac address table of devices you've recently talked to.
Gah! That's what I'm looking for. Thanks! :D

Quote:

And if you are looking to learn things,
You know it slacky. ;)

Quote:

look at a packet sniffer such as tcpdump or Ethereal
Just apt-got 'em yesterday. Still haven't read the man pages though, but will ASAP. Thanks for the reply.

johnMG 04-01-2005 04:34 PM

Wait a sec. Egads! I just logged into my router to have a look at any MAC addresses it might show. Under the heading "Active DHCP Leases", I see a very long list of different MAC addresses -- much more numerous than the number of computers on this LAN.

(BTW, these are all Windows XP systems, and they are shut down and restarted multiple times per day). I had thought all MAC's were "set at the factory" and were different for each card. Is the operating system somehow resetting it? Does GNU/Linux do this?

Ok ok. I know. I'll read the man page for arp tonight. :)


All times are GMT -5. The time now is 02:36 AM.