下面是我的/etc/network/interfaces文件中的内容:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 172.168.10.252
netmask 255.255.255.0
network 172.168.10.0
broadcast 172.168.10.255
gateway 172.168.10.1
iface eth1 inet static
address 172.168.10.251
netmask 255.255.255.0
network 172.168.10.0
broadcast 172.168.10.255
gateway 172.168.10.10我想使用eth0作为本地网络,eth1用于互联网。谢谢
发布于 2017-01-07 18:59:21
要配置两个接口,比如eth0和eth1使用两个网络( 192.168.0.0/24和10.10.0.0/24 ),可以使用一个工具iproute2来实现这一点。
步骤:
/etc/network/interfaces:auto interface #主网络接口允许--热插拔eth0 iface面eth0 iface 192.168.0.10网络掩码255.255.255.0网关192.168.0.1 #二级网络接口允许--热插拔eth1 ifac面管静态地址10.10.0.10 net掩码255.255.255.0/etc/network/interfaces:iface eth1内静态地址10.10.0.10 net掩码255.255.255.0后ip路由添加10.10.0.0/24 dev eth1 src 10.10.0.10表rt2后发ip路由添加默认通过10.10.0.1 eth1表rt2后置ip规则从10.10.0.10/32表rt2 post ip规则添加到10.10.0.10/32表rt2来源:
https://www.thomas-krenn.com/en/wiki/Two_默认设置_出入口_在……上面_一_系统
https://askubuntu.com/questions/868942
复制相似问题