≡ Menu

mac address

FreeBSD: Wake Up Servers Using Wake-on-LAN ( WOL ) Command

I know how to send WOL command using Linux. But, how do I send Wake on LAN (WOL) frames to hosts on a local Ethernet network using FreeBSD operating systems to wake up my servers?
[click to continue…]

Linux Display Ethernet Bridge Name and Information

How do I display a list of bridges under Linux? How do I show info about the Ethernet bridge configuration in the Linux kernel?
[click to continue…]

Red Hat / CentOS: Swap / Change Ethernet Aliases

Q. My Ethernet aliases are randomly switched and they are bound to the wrong interface. My eth0 became eth1 and eth1 become eth0. This is causing all sort of trouble for services and firewall configurations. How do I swap back and make sure Ethernet aliases works correctly under CentOS Linux server?
[click to continue…]

Router ARP Cache is Not Releasing Linux / UNIX Server IP address

Q. Recently we made changes to our server hardware and swapped all IP address from old to a new server. However, 2 IP addresses are not get updated due to arp cache issues (IPs are cached on the router). They are going to other servers. How do I solve this problem under Redhat Enterprise Linux version 5.0 or any other Linux distribution?
[click to continue…]

ICMP IP Network Scanning / Probing using a Shell Commands

Q. How do I check security of my network by running ICMP IP Network Scanning under FreeBSD / Linux? How do I subnet broadcast addresses? All I wanted to see if my firewall is working or not.

A. Internet Control Message Protocol (ICMP) one of the core protocols of the Internet protocol suite. It is chiefly used by networked computers' operating systems to send error messages—indicating, for instance, that a requested service is not available or that a host or router could not be reached.

ICMP IP Network Scanning with nmap tool

You can use regular open source tool called nmap. Type the following command to run ICMP IP Scan:
$ nmap -sP -PI

Starting Nmap 4.20 ( http://insecure.org ) at 2008-01-29 23:40 IST
Host appears to be up.
MAC Address: 00:18:39:6A:C6:8B (Cisco-Linksys)
Host appears to be up.
Nmap finished: 256 IP addresses (2 hosts up) scanned in 5.746 seconds


  • -sP : This option tells Nmap to only perform a ping scan (host discovery), then print out the available hosts that responded to the scan. This is also known as ping scan.
  • -PI : This open tells Nmap that we are sending ICMP echo requests

Squid Proxy Server Mac Address based filtering

Q. I'm using squid proxy server under CentOS Linux version 5. How to filter a particular MAC address under squid?

A. Not all operating system supports Mac address based filtering. For some operating systems. Squid calls these "ARP ACLs" and they are supported on Linux, Solaris, and BSD variants.

How do I set up ACL's based on MAC address?

Open squid.conf:
# vi /etc/squid/squid.conf
Local acl, section and append ACL as follows:
acl macf1 arp mac-address
acl macf2 arp 00:11:22:33:44:55
http_access allow macf1
http_access allow macf2
http_access deny all

Save and close the file. Restart squid server:
# /etc/init.d/squid restart

HowTo: Find Out Router Mac Address

How do I display or find out the MAC address for my small home / business router?
[click to continue…]

How do I find out the MAC address of my Linux or FreeBSD system?

Q. Can you tell me how can I find out MAC address under Linux or FreeBSD server?

A. A mac address is acronym for media access control address, is a unique address assigned to almost all-networking hardware such as Ethernet cards, router etc. Most layer 2 network protocols use one of three numbering spaces managed by the IEEE: MAC-48, EUI-48, and EUI-64, which are designed to be globally unique. (see mac address at wikipedia for more information).

Following command work with Linux and other UNIX oses:

ifconfig command

Ifconfig is used to configure the kernel-resident network interfaces.

In order to find out MAC address of system you can use ifconfig command as follows:
$ /sbin/ifconfig | grep HWaddr

eth0      Link encap:Ethernet  HWaddr 00:0F:EA:91:04:07


$ /sbin/ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0F:EA:91:04:07
        inet addr:  Bcast:  Mask:
        inet6 addr: fe80::20f:eaff:fe91:407/64 Scope:Link
        RX packets:60400 errors:0 dropped:0 overruns:0 frame:0
        TX packets:109216 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:1000
        RX bytes:69273219 (66.0 MiB)  TX bytes:14285799 (13.6 MiB)
        Interrupt:18 Base address:0xc000
lo        Link encap:Local Loopback
        inet addr:  Mask:
        inet6 addr: ::1/128 Scope:Host
        UP LOOPBACK RUNNING  MTU:16436  Metric:1
        RX packets:3869 errors:0 dropped:0 overruns:0 frame:0
        TX packets:3869 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:0
        RX bytes:396498 (387.2 KiB)  TX bytes:396498 (387.2 KiB)

OR as a root user type following command:

# grep eth0 /var/log/dmesg
eth0: RealTek RTL8139 at 0xc000, 00:0f:ea:91:04:07, IRQ 18
eth0:  Identified 8139 chip type 'RTL-8100B/8139D'
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1

FreeBSD example

# ifconfig

lnc0: flags=108843 mtu 1500
        inet 74.xx.yy.zzz netmask 0xfffffff0 broadcast 74.xx.yyy.zzz
        ether 00:0c:29:b8:92:8b
plip0: flags=108810 mtu 1500
lo0: flags=8049 mtu 16384
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
        inet6 ::1 prefixlen 128
        inet netmask 0xff000000

See also: