我有用于互联网的物理网卡,我想在 Linux 上创建一个虚拟网卡。
这是我的配置/etc/网络/接口
# Public
auto eth0
iface eth0 inet static
address 46.40.127.45
netmask 255.255.255.0
network 46.40.127.0
broadcast 46.40.127.255
gateway 46.40.127.1
dns-nameservers 8.8.8.8
dns-search com
# Private
auto eth1
iface eth1 inet static
address 10.10.10.1
netmask 255.255.255.0
这就是我得到的/etc/init.d/networking 重启
Cannot find device "eth1"
Failed to bring up eth1.
答案1
那么您需要指定它连接到哪个硬件接口。
尝试这个,
# Public
auto eth0
iface eth0 inet static
address 46.40.127.45
netmask 255.255.255.0
network 46.40.127.0
broadcast 46.40.127.255
gateway 46.40.127.1
dns-nameservers 8.8.8.8
dns-search com
# Private
auto eth0:1
iface eth0:1 inet static
address 10.10.10.1
netmask 255.255.255.0
详情可参阅这里