2015년 5월 31일 일요일

[Gentoo Linux] Routing for multiple uplinks/providers / 젠투 멀티 게이트웨이이

- ISP 1 
NIC :  eno1  ip : 192.168.50.2/24 
IP : 192.168.50.2/24
GW: 192.168.50.1

- ISP 2
NIC:  eno2 
IP : 192.168.100.2/24
GW: 192.168.100.1

==========================
sys-apps/baselayout Installed
sys-apps/openrc Installed
sys-apps/iproute2 Installed
==========================

** /etc/iproute2/rt_tables
(add)
50 ISP1
100 ISP2


** /etc/conf.d/net
modules="iproute2"
#ISP1 Network
config_eno1="192.168.50.2/24"
routes_eno1="default via 192.168.50.1"
metric_eno1="10"

routes_eno1="
192.168.50.0/24 dev eno1 src 192.168.50.2
192.168.50.0/24  dev eno1 scope link src 192.168.50.2 table ISP1
default via 192.168.50.1 table ISP1
"
rules_eno1="from 192.168.50.2 table ISP1"




#ISP2 Network
config_eno2="192.168.100.2/24"
metric_eno2="20"
routes_eno2="
192.168.100.0/24 dev eno2 src 192.168.100.2
192.168.100.0/24 dev eno2 scope link src 192.168.100.2 table ISP2
default via 192.168.100.1 table ISP2
"
rules_eno2="from 192.168.100.2 table ISP2"

ip route add default scope global nexthop via 192.168.50.1 dev eno1 weight 1 nexthop via 192.168.100.1 eno2 weight 1



Network restart or Reboot.


--test 
traceroute -s 192.168.50.2 google.com
traceroute -s 192.168.100.2 google.com



http://lartc.org/howto/lartc.rpdb.multiple-links.html