FreeBSD Display Current IP Address, Netmask and Ethernet Options

Fig.01: FreeBSD Display Current IP Address, Netmask and Ethernet Options

Fig.01: FreeBSD Display Current IP Address, Netmask and Ethernet Options

You need to use the ifconfig command to display IP address, netmask/subnet and other information. The same command is also used to assign an address to a network interface and/or configure network interface parameters. on a FreeBSD Unix server or laptop. The syntax is:

ifconfig 
ifconfig -a
ifconfig -a | more
ifconfig interface
ifconfig rlx0
ifconfig em0 | grep 'something'

Sample outputs:

em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
	ether 08:00:27:e6:57:50
	inet 192.168.1.142 netmask 0xffffff00 broadcast 192.168.1.255 
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: Ethernet autoselect (1000baseT <full-duplex>)
	status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
	inet6 ::1 prefixlen 128 
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 
	inet 127.0.0.1 netmask 0xff000000 
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

The em0 is my Ethernet interface and lo0 is my loopback interface on a FreeBSD 10 server.

Examples and usage: FreeBSD Force DHCP Client (dhclient) to Renew IP Address To Get A New Lease