虚拟机 ubuntu 桥接连不上网 ping不通内外网

设置好了桥接,静态的ip信息也填完了,但依然连不上网。

最后发现是网络设置里面的网卡默认选错了

ifconfig 看一下 有的叫eth0 新一些的ubuntu叫ens33,选择即可。

设置静态ip

sudo vi /etc/network/interfaces

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.0.222
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameserver 192.168.1.1

DNS   /etc/resolv.conf    ubuntu18 修改 sudo vi /etc/systemd/resolved.conf

开启ssh 远程连接

sudo apt-get install openssh-server

sudo service ssh start

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章