Ubuntu16.04 configure your own network card information

**The title is Ubuntu16.04, but it is estimated to be applicable to 18.x. **

step###

View network card name####

First enter ifconfig to view the network card name,

Configuration file

sudo vi /etc/network/interfaces

The most annoying thing is that different Linux versions have different configuration files. For example, the file location and name of CentOS and Ubuntu are different.

default:

Configure static IP

The most commonly used, static IP is generally configured in the virtual machine, because I want to connect to Ubuntu in the virtual machine through ssh.

The modification is as follows: The following ens33 needs to be changed to the name of your own network card, which is the red circle information in the first step above. The ip address and mask gateway can be configured reasonably by themselves. Remember wq! Save and exit.

auto ens33
iface ens33 inet static
address 192.168.184.8
netmask  255.255.255.0
gateway  192.168.184.2
dns-nameservers 114.114.114.114

How to configure IP address and gateway reasonably? Look at the virtual network configuration of the VM:
Open VM: Edit | Virtual Network Editor

Dynamic IP

If you want to configure dynamic IP, the following content is sufficient:

auto ens33
iface ens33 inet dhcp
dns-nameservers 114.114.114.114

Note that the above network card (ens33) is written as your own network card name. Remember wq! Save and exit.

Restart

reboot

Restart the computer to make the configuration take effect

verification####

Type ifconfig

**Link via xshell: **

**Successfully configured! ! **

Recommended Posts

Ubuntu16.04 configure your own network card information
Ubuntu configure network commands
Ubuntu 18.04 uses elastic network card to configure multiple external network IP
Ubuntu configure Tomcat
Ubuntu configure Apache
Ubuntu wireless network card problem on Lenovo laptop
ubuntu 14.04 configure 3-wire 3IP
Network configuration under Ubuntu
Ubuntu18.10 configure Java environment
Ubuntu 18.10 configure Nvidia driver
Ubuntu own software record
Ubuntu configure SecureCRT login