THE IFCONFIG CMD
ifconfig CMD is utilized for network configuration. If you type ifconfig into your command line, it will list currently active network adapters. You can drill down to a specific adapter by typing the name of the adapter coupled with the ifconfig command, for example:
However, this shoes only active adapters. You can see all adapters by typing
It doesn’t stop there, though. The ifconfig has many more valuable functions. You can use it to configure interfaces!
Now, a heads up, but ifconfig alterations are temporary. That means if you’re messing around and wanting to change the IP, you can use the ifconfig command to do this and know these changes wont survive a reboot. To make a change with ifconfig, you can utilize something like; ifconfig eth0 192.168.1.5to change the IP. You can also add more variables… so something like the following;
ifconfig eth0 192.168.1.5 netmask 255.255.255.0 broadcast 192.168.1.255
To make more permanent changes, you would want to modify the adapter’s network script located; /etc/sysconfig/network-scripts/ifcfg-eth0. Changes made to these scripts should survive a server reboot.
Finally, you can also use ifconfig to turn an adapter on and off. You can do this by simply typing the CMD + adapter; ex:
ifconfig eth0 up or
ifconfig eth0 down (running these commands should refresh your DHCP).
Remember to review your man pages! The
man ifconfig pages can melt your face off with information.