Barra de espaço
Barra de espaço

This tutorial presents a detailed procedure showing how to configure static IP address on a computer running Ubuntu linux.

YOUTUBE

In our channel you can view the video of this tutorial.




Before starting the configuration we must ensure that the Linux system recognized a network card in your system.

# lspci | grep –i ethernet


The lspci command list PCI cards connected to the system and the grep command is filtering only for ethernet network cards.

In our example, a network card was found.
ubuntu configurar rede ip 1

Edit the network interface configuration file located in the directory /etc/network.

# vi /etc/network/interfaces

auto lo eth0

iface lo inet loopback
iface eth0 inet static

address 192.168.0.10
netmask 255.255.255.0
gateway 192.168.0.1

When you finish editing the configuration file run the following command to stop the network interface eth0 of Ubuntu.

# ifdown eth0


Use the following command to start the ETH0 network interface.

# ifup eth0


Verify if the interface is up and running with the new IP address configuration using the ifconfig command.

# ifconfig


 

Test the connectivity to the internal network through the ping command to your gateway address.

# ping 192.168.0.1

 

Or, test the connectivity to the internet trying to ping google.

# ping 8.8.8.8

Restart the computer to make sure everything will work correctly at boot time.

 

CONCLUSION

This tutorial introduced the static IPv4 address configuration process.