Since we cannot use default_route= more than once. How does one add a second? I can't seem to find the correct documentation to help me understand this in BSD! Thank you very much and Merry Christmas!
Using more than one string in static_routes creates multiple static routes. The following shows an example of adding static routes for the 192.168.0.0/24 and 192.168.1.0/24 networks:
gateway_enable="YES" # Set to YES if this host will be a gateway
static_routes="net1 net2"
route_net1="-net 192.168.0.0/24 192.168.0.1"
route_net2="-net 192.168.1.0/24 192.168.1.1"
FreeBSD can implement multiple routing tables (and thus multiple default routes) but I suspect that's probably not what you are enquiring about.
Would you please give us some more information about the specifics of the problem you are trying to solve?
The handbook may help.
I looked at your subject line again, and conclude that you probably want to implement static routes. It's in section 31.2.2 of the handbook:Code:Using more than one string in static_routes creates multiple static routes. The following shows an example of adding static routes for the 192.168.0.0/24 and 192.168.1.0/24 networks: gateway_enable="YES" # Set to YES if this host will be a gateway static_routes="net1 net2" route_net1="-net 192.168.0.0/24 192.168.0.1" route_net2="-net 192.168.1.0/24 192.168.1.1"
gateway_enable="YES"
static_routes="gw1 gw2"
route_gw1="-net 104.36.16.0/24 104.36.16.1"
route_gw2="-net 185.12.4.0/24 185.12.4.1"
ifconfig_em0="104.36.16.185 netmask 255.255.255.0"
ifconfig_em1="104.36.16.37 netmask 255.255.255.0"
ifconfig_em2="104.36.16.72 netmask 255.255.255.0"
ifconfig_em3="185.12.4.102 netmask 255.255.255.0"
gpw928,That "x" is not valid in an IP address. On the information provided, you probably want:Code:gateway_enable="YES" static_routes="gw1 gw2" route_gw1="-net 104.36.16.0/24 104.36.16.1" route_gw2="-net 185.12.4.0/24 185.12.4.1" ifconfig_em0="104.36.16.185 netmask 255.255.255.0" ifconfig_em1="104.36.16.37 netmask 255.255.255.0" ifconfig_em2="104.36.16.72 netmask 255.255.255.0" ifconfig_em3="185.12.4.102 netmask 255.255.255.0"
It's a little bit unusual to have three NICs (em0, em1, and em2) on the same subnet (104.36.16.0/24) -- which is why you need the static routes.
defaultrouter="192.168.1.254"
static_routes="path2"
route_path2="-net 192.168.1.0/24 192.168.3.254"
This seems strange. Your default router should be your next hop (one of your interface addresses should be on the same subnet).Code:defaultrouter="192.168.1.254" static_routes="path2" route_path2="-net 192.168.1.0/24 192.168.3.254"