一、设置静态IP及DHCP网络服务

kk@yuanqiangfei:~$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0                                                #eth0网卡开机启动
iface eth0 inet dhcp                                    #使用DHCP服务器申请动态IP
#iface eth0 inet static                                 #设置eth0网卡静态IP
#address 192.168.1.188                               #静态IP   
#netmask 255.255.255.0                               #掩码
#gateway 192.168.1.1                                  #网关   

二、修改DNS 

kk@yuanqiangfei:~$ cat /etc/resolvconf/resolv.conf.d/base
nameserver 192.168.3.1
nameserver 192.168.1.1
kk@yuanqiangfei:~$ ^C
kk@yuanqiangfei:~$ resolvconf -u

查看修改是否成功: 

linux系统设置静态IP,DHCP网络服务,DNS

修改相关参数之后重启网络:

sudo service networking restart

  

 

  

相关文章:

  • 2021-04-06
  • 2021-08-24
  • 2021-12-03
  • 2022-12-23
  • 2021-04-22
  • 2022-01-23
  • 2021-10-31
  • 2022-02-01
猜你喜欢
  • 2021-06-13
  • 2021-11-10
  • 2022-01-22
  • 2021-12-24
  • 2021-04-08
  • 2021-05-21
  • 2021-08-19
相关资源
相似解决方案