The ifconfig command can be used to view information about active Linux NICs and IP addresses, subnet masks, and MAC addresses.
- [Root @ localhost ~] # Ifconfig
- Eth0 link encap: Ethernet hwaddr 08: 00: 27: D4: 71: 2D
- Inet ADDR: 192.168.1.104 bcast: 255.255.255.255 mask: 255.255.255.0
- Inet6 ADDR: fe80: a00: 27ff: fed4: 712d/64 scope: Link
- Up broadcast running Multicast MTU: 1500 Metric: 1
- RX packets: 1693 errors: 0 dropped: 0 overruns: 0 frame: 0
- TX packets: 255 errors: 0 dropped: 0 overruns: 0 carrier: 0
- Collisions: 0 FIG: 1000
- RX Bytes: 118346 (115.5 kib) TX Bytes: 53987 (52.7 kib)
- Interrupt: 10 Base Address: 0xd020
- 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: 7 errors: 0 dropped: 0 overruns: 0 frame: 0
- TX packets: 7 errors: 0 dropped: 0 overruns: 0 carrier: 0
- Collisions: 0 txqueuelen: 0
- RX Bytes: 672 (672.0 B) TX Bytes: 672 (672.0 B)
Eth0 is a network card of a Linux host, and lo is a local loopback
Ifconfig eth0 up # enable Nic
Ifconfig eth0 down # enable Nic
Ifconfig eth0 192.168.1.101 # You can specify a static address for the host.
To use DHCP allocation, run the dhclient command.
Enter dhclient directly on the terminal :)