Ubuntu: Difference between revisions

1,337 bytes added ,  6 years ago
Line 317:
 
==== Networking in 17.10 onwards ====
This new tool replaces the static interfaces (/etc/network/interfaces) file that had previously been used to configure Ubuntu network interfaces.
Now you must use /etc/netplan/*.yaml to configure Ubuntu interfaces.
 
The new interfaces configuration file now live in the /etc/netplan directory.
A file called 01-netcfg.yaml is used to configured the first interface.
Below is the default configuration for a interface using DHCP.
<pre>
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
ens33:
dhcp4: yes
dhcp6: yes
</pre>
 
To save your changes, you run the commands below.
sudo netplan apply
 
Configuring Static IP Addresses
 
To configure a static IP address using the new NetPlan tool, the file should look like this: IPv4 address (192.168.1.2), Gateway (192.168.1.1), DNS Servers (8.8.8.8,8.8.4.4)
<pre>
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
ens33:
dhcp4: no
dhcp6: no
addresses: [192.168.1.2/24]
gateway4: 192.168.1.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]
</pre>
 
Exit and save your changes by running the commands below
sudo netplan apply
 
===Software Centre===