Add Eth0 but there is LO and ENS160
You're probably trying to follow obsolete instructions.
ens160
is a new-style network device name, while eth0
is old-style.
Also, modern Ubuntu uses netplan
to configure network settings: you should create (or edit, if one already exists) a simple *.yaml
file describing your desired network configuration in /etc/netplan/
directory, and then run sudo netplan apply
to make it take effect.
For example, to set IP address 10.10.10.2 with netmask 255.255.255.0 (i.e. prefix /24), default gateway 10.10.10.1, DNS server 10.10.10.1 and 1.1.1.1 with default DNS search domains mydomain.example
and otherdomain.example
, you would write this into e.g. /etc/netplan/99_config.yaml
:
network:
version: 2
renderer: networkd
ethernets:
ens160:
addresses:
- 10.10.10.2/24
gateway4: 10.10.10.1
nameservers:
search: [mydomain.example, otherdomain.example]
addresses: [10.10.10.1, 1.1.1.1]
Note that in YAML, correct indentation is an important part of the syntax.
Related videos on Youtube
![Jeff Schaller](https://lh4.googleusercontent.com/-wBY-4a1-0jo/AAAAAAAAAAI/AAAAAAAAAfc/4BCoMMK1rqg/photo.jpg?sz=256)
Jeff Schaller
Unix Systems administrator http://www.catb.org/esr/faqs/smart-questions.html http://unix.stackexchange.com/help/how-to-ask http://sscce.org/ http://stackoverflow.com/help/mcve
Updated on September 18, 2022