sudo gedit /etc/network/interfaces
edit:
auto eth0
iface eth0 inet static
address 192.168.137.3
gateway 192.168.137.2
netmask 255.255.255.0
(注意net网卡mac地址,需要对应)
sudo /etc/init.d/networking restart
sudo gedit /etc/resolvconf/resolv.conf.dbase
edit:
nameserver 8.8.8.8
nameserver 192.168.137.1
sudo /etc/init.d/resolvconf restart
sudo gedit /etc/resolv.conf查看dns是否修改成功
reboot
ifconfig查看是否修改成功
sudo /etc/init.d/networking restart
ping www.baidu.com
博客介绍了在Linux系统中进行网络和DNS配置的步骤。包括编辑网络接口文件设置静态IP、网关和子网掩码,编辑DNS配置文件,重启网络和DNS服务,查看配置是否成功,最后通过ping命令测试网络连通性。

被折叠的 条评论
为什么被折叠?



