≡ Menu

ifconfig command

FreeBSD Configure NIC Jumbo Frames

Q.Under Linux I can set Jumbo Frames by modifying configuration file. How do I configure FreeBSD network card to enable Jumbo frames on all of my NIC for 1000 Mbps speed and make MTU configuration persistence?
[click to continue…]

FreeBSD Set Speed Duplex For My Network Card ( NIC )

Q. How do I set / change the speed ( duplex settings ) on my FreeBSD network card? I’d like to change default 10Mbps to 100Mbps or vice versa. Linux user can use ethtool to set an Ethernet card speed and duplex, can I use the same command on FreeBSD?
[click to continue…]

Debian Linux Configure Network Interface Cards – IP address and Netmasks

How do I configure networking or network interface card on HP Debian Linux U1 Server?
[click to continue…]

HowTo Bind A Range Of IP’s in Debian / Ubuntu Linux

I‘ve recently installed Debian Linux 4.0 on my server and Ubuntu Linux 7.04 on Laptop. I would love to have a multiple IP address that I can use for verity of purposes. I would like to bind 4 IP’s to the ‘eth0’ device or NIC. How do I achieve this?
[click to continue…]

Linux change ip address

Q. How do I change ip address in Linux?

A. There are different ways to change IP address in Linux
(a) Command Line tools

(b) Modify configuration files

(c) Use GUI tools

Task: Display current IP address and setting for network interface called eth0

Use ifconfig command:
# ifconfig eth0
Output:

eth0      Link encap:Ethernet  HWaddr 00:30:48:5A:BF:46
          inet addr:10.5.123.2  Bcast:10.5.123.63  Mask:255.255.255.192
          inet6 addr: fe80::230:48ff:fe5a:bf46/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:728204 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1097451 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:62774749 (59.8 MiB)  TX bytes:1584343634 (1.4 GiB)
          Interrupt:177

Task: Change IP address

You can change ip address using ifconfig command itself. To set IP address 192.168.1.5, enter command:
# ifconfig eth0 192.168.1.5 netmask 255.255.255.0 up
# ifconfig eth0

To make permanent changes to IP address you need to edit configuration file according to your Linux distribution.

Change IP address under RedHat / CentOS / Fedora core Linux

=> Please read – Howto change and setup IP address in Redhat Linux

Change IP address under Debian / Ubuntu Linux

=> Please read – Howto change and setup IP address in Ubuntu / Debian based Linux distros

Linux command to remove virtual interfaces or network aliases

Q. How do I remove virtual interfaces such as eth0:1 or eth1:1?
[click to continue…]

Linux Creating or Adding New Network Alias To a Network Card (NIC)

Q. I would like to create alias for my network card (NIC). How do I setup 2 IP address on One NIC? How do I add alias under Centos / Fedora / Debian / Ubuntu Linux?
[click to continue…]

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…]

Bash Shell Command to Find or Get IP address

How do I find out my Linux / UNIX system ip address, subnet and related networking information from a command prompt?
[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
Output:

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

OR

$ /sbin/ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0F:EA:91:04:07
        inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
        inet6 addr: fe80::20f:eaff:fe91:407/64 Scope:Link
        UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
        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:127.0.0.1  Mask:255.0.0.0
        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
Output:

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 127.0.0.1 netmask 0xff000000

See also: