需要使用两个Ip。
一个外网Ip(绑定wifi网卡),一个内网(静态,与宿主机交互。)。
网络设置添加两个网卡。
设置dns
cat /etc/resolvconf/resolv.conf.d/base
nameserver 8.8.8.8
nameserver 8.8.4.4
设置静态ip .
cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto enp0s3
iface enp0s3 inet dhcp
auto enp0s8
iface enp0s8 inet static
address 192.168.56.100
netmask 255.255.255.0
网上找的教程都是这样或那样的问题。
适合自己的才是最好的!