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.(SOON)



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

# lshw -C network

 

ubuntu17 network
 
Take note of the logical name of your network interface.

In our example, a network card ens160 was found.

Edit the network interface configuration 01-netcfg.yaml file located in the directory /etc/netplan.

# vi /etc/netplan/01-netcfg.yaml

network:
version: 2
renderer: networkd
ethernets:
ens160:
dhcp4: no
dhcp6: no
addresses: [192.168.0.10/24]
gateway4: 192.168.0.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]

 

When you finish editing the configuration file run the following command to restart the network interfaces of ubuntu 17:

# netplan apply



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 on a computer running ubuntu 17.