It has never been too painful for me to setup my IP address and default gateway blah blah blah in my Windows world, however it is not the same case when comes to Linux. Nevertheless, it is relatively easy as well.
Each Linux distro stores their network configuration file in a different location. For instance, Debian keeps the config file that contains the IP information in /etc/network/interfaces. By making changes to the file, we can actually statically changing the TCP/IP information for the workstation. The changes is permanent, that carries the meaning that the changes stay even you reboot your system.
The next method which just give a temporary effect is Command-line Configuration. There are just 2 commands needed in order to make things work:
host:~# ifconfig eth0 {ip add} netmask {subnet mask}
host:~# route add default gw {gateway add}
The first command tells the system to configure Ethernet adapter 0 on your NIC to have {ip add} as the IP address with {subnet mask} as the netmask. The second command configures the gateway of the system. However, it should be noted that the configuration will lose once the device is turned off or reboot.
Lastly, to check whether or not the TCP/IP changes have been made on the NIC, there are 2 commands could be used, depending on your choice:
route
or
netstat -nr
By issuing one of the commands, you can verify whether the changes have take effect with looking at the routing table.
ps: Note that you will need super user privilege in order to perform the configuration. “sudo bash” could be used in some case.
Powered by ScribeFire.