Answers:
绝对有可能。您需要正确配置路由才能执行此操作。您希望默认路由通过eth1,因此路由表应如下所示:
$ /sbin/route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.10.19.0 * 255.255.255.0 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth1
使用该route print
命令,Windows看上去会有些相似(当然还有格式的变化)。
您可以route
在任一平台上使用命令动态设置路由。我不确定您需要将哪个配置选项设置为默认配置(显然将另一个配置为非默认配置)...将使用该信息进行编辑。
编辑:如果您正在使用GNOME或KDE GUI网络管理器,请在eth1
设备配置中查找“将此接口设置为默认值”选项。
如果您是/etc/network/interfaces
手工配置的,请查看本HOWTO中的示例。特别是,该up
选项允许您在界面出现后运行命令。在您的情况下,您可能需要使用该命令在额外的默认路由上运行route-delete命令,或者如果两个接口都未将其自身设置为默认路由,则要运行route-add:
# example /etc/network/interfaces
# replace the IP addresses in the route-del and route-add commands below
# with those appropriate to your network
auto eth0
iface eth0 inet dhcp
up route del default gw 10.10.19.1
# runs a route-delete if dhcp adds a default gateway for this interface
auto eth1
iface eth1 inet dhcp
up route add default gw 192.168.1.1
# runs a route-add if dhcp neglects to add a default gateway for this interface