Hi,
I've 2 nics connected to 2 different upstreams on my server. IPs are private so i've changed them. I need to configure that both subnets should be active.
nics : bce1 ve bge1
when nics up, FreeBSD adds all routes to fib 0 (default fib) and doesnt allow to remove or change.
what I've tried;
1) static routes only 1 route table (fib0)
2) defaultrouter enabled for any of interfaces
both subnets are accessable but if defaultrouter or nic connected to it gets down both is unavailable.
3) multiple route tables and multiple defaulrouters
net.fibs:2
also net.add_addr_allfibs=1
FreeBSD adds add all routes to default fib (sysctl net.my_fibnum -> net.my_fibnum: 0) so second route table doesnt affect.
4) multiple route table and static routes
same result as 2, because of FreeBSD adds all routing to default fib (fib0).
Is there any solution for this simple problem? What I've missed?
Thanks,
I've 2 nics connected to 2 different upstreams on my server. IPs are private so i've changed them. I need to configure that both subnets should be active.
nics : bce1 ve bge1
Code:
ifconfig_bce1="inet 172.20.20.66 netmask 255.255.255.248" -> gw : 172.20.20.65
ifconfig_bge1="inet 192.100.254.154 netmask 255.255.255.248" -> gw : 192.100.254.153
Code:
Destination Gateway Flags Refs Use Netif Expire
172.20.20.64/29 link#6 U 0 0 bce1
172.20.20.66 link#6 UHS 0 0 lo0
127.0.0.1 link#9 UH 0 0 lo0
192.100.254.152/29 link#2 U 0 0 bge1
192.100.254.154 link#2 UHS 0 0 lo0
Code:
[ root@host ] ~ $ route del -net 192.100.254.152/29
route: writing to routing socket: Address already in use
del net 192.100.254.152 fib 0: gateway uses the same route
what I've tried;
1) static routes only 1 route table (fib0)
Code:
static_routes="uplink0 uplink1"
route_uplink0="-net 172.20.20.64/29 172.20.20.65"
route_uplink1="-net 192.100.254.152/29 192.100.254.153"
Code:
route: writing to routing socket: Address already in use
delete net 172.20.20.64: gateway 172.20.20.65 fib 0: gateway uses the same route
route: writing to routing socket: Address already in use
delete net 192.100.254.152: gateway 192.100.254.153 fib 0: gateway uses the same route
route: writing to routing socket: File exists
add net 172.20.20.64: gateway 172.20.20.65 fib 0: route already in table
route: writing to routing socket: File exists
add net 192.100.254.152: gateway 192.100.254.153 fib 0: route already in table
2) defaultrouter enabled for any of interfaces
Code:
defaultrouter="192.100.254.153"
both subnets are accessable but if defaultrouter or nic connected to it gets down both is unavailable.
3) multiple route tables and multiple defaulrouters
Code:
ifconfig_bce1="inet 172.20.20.66 netmask 255.255.255.248 fib 0 "
ifconfig_bge1="inet 192.100.254.154 netmask 255.255.255.248 fib 1"
setfib 0 route add default 172.20.20.65
setfib 1 route add default 192.100.254.153
also net.add_addr_allfibs=1
FreeBSD adds add all routes to default fib (sysctl net.my_fibnum -> net.my_fibnum: 0) so second route table doesnt affect.
4) multiple route table and static routes
Code:
static_routes="uplink0 uplink1"
route_uplink0="-net 172.20.20.64/29 172.20.20.65 -fib 0"
route_uplink1="-net 192.100.254.152/29 192.100.254.153 -fib 1"
same result as 2, because of FreeBSD adds all routing to default fib (fib0).
Is there any solution for this simple problem? What I've missed?
Thanks,