# More than one default route



## bgpn00b (Feb 4, 2010)

Hello *,

I am having problems with my BGP daemon and the way it modifies the kernel routing table. Si I decided I won't let it add any routes and because I am only using my two BGP sessions with the two ISPs for failover purposes I will add the route for the second ISP manually.

This means that I need to add a second default route and that is where I have hit a wall. I don't know how to do this in FreeBSD 7.1.

# netstat -r
Routing tables

Internet:
Destination________Gateway____________Flags____Refs______Use__Netif_Expire
localhost__________localhost__________UH__________0________0____lo0
default____________1.1.1.25___________UGS_________0__1525923____rl0
1.1.1.24/30________link#2_____________UC__________0________0____rl0
1.1.1.25___________00:1c:b0:cb:7b:00__UHLW________2_____2713____rl0____228
1.1.1.26___________00:1d:0f:c0:55:3b__UHLW________1_____1922____lo0
2.2.2.116/30_______link#3_____________UC__________0________0____rl1
2.2.2.117__________00:b0:c2:85:4a:03__UHLW________1_______30____rl1____868
2.2.2.118__________00:19:e0:14:66:8b__UHLW________1______430____lo0
192.168.100.0______link#1_____________UC__________0______141___bge0
192.168.100.3______00:15:17:31:eb:93__UHLW________1___101891___bge0___1185
192.168.100.4______00:04:23:c1:cb:7a__UHLW________1____23441___bge0___1171
3.3.3.0____________ff:ff:ff:ff:ff:ff__UHLWb_______1________0__vlan0_=>
3.3.3.0____________link#8_____________UC__________0___221427__vlan0
3.3.3.1____________00:18:8b:7b:8f:4e__UHLW________1_______46____lo0
3.3.3.2____________00:11:11:c8:0d:35__UHLW________1_____8078__vlan0____833
3.3.3.255__________ff:ff:ff:ff:ff:ff__UHLWb_______1________0__vlan0


# route add -net 0.0.0.0/0 2.2.2.117
route: writing to routing socket: File exists
add net 0.0.0.0: gateway 2.2.2.117: route already in table
# route add default 193.226.132.117
route: writing to routing socket: File exists
add net default: gateway 193.226.132.117: route already in table


----------



## SirDice (Feb 4, 2010)

There can be only one default gateway. That's why it's called a "default gateway".


----------



## Alt (Feb 4, 2010)

Why you forbid bgpd to modify routes?


----------



## bgpn00b (Feb 4, 2010)

Hmm. It seems that you CAN have multiple default routes:
http://lists.freebsd.org/pipermail/cvs-src/2008-April/089956.html
Someone in another forum says that this works only in FreeBSD 8.


----------



## SirDice (Feb 4, 2010)

If I were you I'd try to fix BGP.


----------



## bgpn00b (Feb 4, 2010)

I agree with you, but that is besides the point.


----------

