第1招配置DHCP
vim /etc/network/interfaces.d/eth0
在该文件内写入以下内容,然后保存退出?
auto eth0
iface eth0 inet dhcp
?使用以下命令重启网络
?/etc/init.d/networking restart
?第2招配置IP
使用以下命令
vim /etc/network/interfaces.d/eth0
auto eth0
iface eth0 inet static
address 192.168.18.202
netmask 255.255.255.0
gateway 192.168.18.1
?使用以下命令重启网络
/etc/init.d/networking restart
?第3招配置DNS
vim /etc/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 8.8.8.8
options edns0
?nameserver 也可配置为8.8.8.8
您的每次点赞都是作者不断创作的动力!谢谢我的朋友们~
有问题直接评论,我看到会及时回复的!
|