Debian修改网络

由于debian9修改了网卡名称为enp3s0

1:修改/etc/network/interfaces

 

auto lo
iface lo inet loopback
auto  enp3s0
iface enp3s0 inet static
address 192.168.1.111 
netmask 255.255.255.0
gateway  192.168.1.1

2:修改/etc/resolv.conf

 

nameserver = 114.114.114.114 //DNS1
nameserver = 8.8.8.8  //DNS2

3:修改/etc/NetworkManager/NetworkManager.conf

 

managed = true

4:重启network

 

sudo systemctl restart networking.service
sudo systemctl restart network-manager


更改主机名:hostnamectl set-hostname test1

你可能感兴趣的:(运维)