Возникло несколько вопросов по данной команде.
Есть два провайдера:
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
allow-hotplug eth1
auto eth1
iface eth1 inet dhcp
# metric 1
hwaddress ether 00:1D:92:0F:9B:A5
# address 10.0.4.104
# netmask 255.255.0.0
# gateway 10.0.3.1
allow-hotplug eth2
auto eth2
iface eth2 inet static
# metric 10
address 192.168.1.33
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1
Есть правила для роутинга:
#!/bin/sh
IF0=eth0
P0_NET=192.168.0.0/24
IF1=eth1
P1_NET=10.0.0.0/16
P1=10.0.3.1
IP1=10.0.4.104
IF2=eth2
P2_NET=192.168.1.0/24
P2=192.168.1.1
IP2=192.168.1.33
ip route add $P1_NET dev $IF1 src $IP1 table T1
ip route add default via $P1 table T1
ip route add $P2_NET dev $IF2 src $IP2 table T2
ip route add default via $P2 table T2
ip route add $P1_NET dev $IF1 src $IP1
ip route add $P2_NET dev $IF2 src $IP2
ip rule add from $IP1 table T1
ip rule add from $IP2 table T2
ip route add $P0_NET dev $IF0 table T1
ip route add $P1_NET dev $IF1 table T1
ip route add 127.0.0.0/8 dev lo table T1
ip route add $P0_NET dev $IF0 table T2
ip route add $P2_NET dev $IF2 table T2
ip route add 127.0.0.0/8 dev lo table T2
#ip route add default via $P1
ip route replace default scope global nexthop via $P1 dev $IF1 weight 10 nexthop via $P2 dev $IF2 weight 1