本地网络配置
临时配置IP地址
注意使用桥接网络请根据宿主机Ip地址修改
ifconfig eth0 192.168.1.56/24 # 临时配置IP
route add default gw 192.168.1.1 # 配置默认路由
echo nameserver 114.114.114.114 > /etc/resolv.conf # 配置DNS
如果 出现错误 网络不可达错误
解决方法:打开网卡配置文件
vim /etc/network/interfaces
添加以下内容
auto eth0
iface eth0 inet dhcp
永久配置IP地址
注:使用桥接网络请根据宿主机IP地址修改
vim /etc/network/interfaces
添加以下内容
auto eth0
# iface eth0 inet dhcp # 如果源文件中有这一行,就注释
iface eth0 inet static
address 192.168.1.53 # IP地址,你的主机IP地址
netmask 255.255.255.0

最低0.47元/天 解锁文章
490

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



