The command which allows for all these manipulations at your network card is ifconfig.
This command to type as root, allows mainly:

  • Define or change the IP address of an interface,
  • To change the Subnet Mask,
  • Activate and deactivate an interface.


In this trick, we use the interface "eth0" which is the first ethernet interface on your PC. If you have more than one interface, the second will be called "eth1" and so on.

To set or change the IP address of the interface "eth0" giving value "192.168.0.1", it is necessary to type the following command:

ifconfig eth0 192.168.0.1

To change the mask and set to "255.255.255.0" , the command is: ifconfig eth0 netmask 255.255.255.0.

To activate / deactivate an interface, the command is: ifconfig eth0 up to activate and ifconfig eth0 down to clear it.

To check your configuration, you can type ifconfig-a show that you configure your network cards.