Linux Kali 命令行版手动设置网络
于 2021-04-27 11:48:41 首次发布
ifconfig
查看IP地址 可以看到没有IPv4地址或者有IPv4地址 但是却无法联网sudo vim /etc/network/interfaces
输入密码 修改IP地址i
进入编辑模式 将 allow-hotplug eth0
和 iface eth0 inet dhcp
这两行禁用auto eth0
iface eth0 inet static
address IP地址
netmask 子网掩码
gateway 网关
ESC
退出编辑模式 Shift+;
输入 wq
保存并退出sudo vim /etc/resolv.conf
输入密码 修改DNS地址i
键进入编辑模式 将第一行禁用DNS
202.99.160.68
是我当前网络必须要配置的 不用照着我的来ESC
退出编辑模式 Shift+;
输入 wq
保存并退出sudo /etc/init.d/networking restart
重启网络服务 ifconfig
查看IP地址 看到IPv4地址已经出现ping baidu.com
发现可以连通 网络配置成功