More than one defaultrouter

Hi,

I'm setting up a server. It has a main IPV4-adress, set up with its Netmask and defaultroute.
I do have a subnet with a different gateway (the main IPV4-address by the way), which I want to use to set an network alias to an IPV4-Adress in it's range.
For what I've read, i have to use the Forwarding Information Base (FIB), enabling it in loader conf.
Something in rc.conf like:
ifconfig_em0="inet 213.239.197.36 netmask 255.255.255.224"
defaultrouter="213.239.197.33"
ifconfig_em0_alias0="inet 88.198.91.234 netmask 255.255.255.248 fib1"
defaultrouter_fib1="213.239.197.36"

Is this the way to go or am I on the wrong track?

Any help appreciated,

Regards Hanns
 
You can only have one defaultroute to your main router which is expected to resolve next step routing.
if you have a second network I/F that is not connected to the above router. you need to either define specific routes for that interface
or use a routing protocol if the second network supports it.

A Router needs to have an interface on the same subnetwork as your computer.

213.239.197.36 is not on the same subnetwork as 88.198.91.234 so these two IP stations can not communicate.
you need a router on the 88.198.91.232 network 88.198.91.233 - 88.198.91.238 defined by the netmask 248 to 6 usable
ip numbers on that subnetwork.

SO if you router is 88.198.91.238 :

# route add "destination IP subnetwork" "gateway" 1
# route add 213.239.197.0 88.198.91.238 1
 
Hi,

thanks for Your reply. It turned out that a simple alias-declaration was enough. Might be related to the networt-infrastructure of my ISP.

Regards Hanns
 
Never tried (don't have IPv6 Internet connections) so I could be wrong, but I think IPv4 and IPv6 on single physical interface can specify different (physical and/or virtual) router as default "per protocol".

For example, router A propagates RA for IPv6, while router B propagates IPv4 configurations via DHCP.

In this case, I think IPv6 connections go to router A by default, while IPv4 connections go to router B by default.
 
Never tried (don't have IPv6 Internet connections) so I could be wrong, but I think IPv4 and IPv6 on single physical interface can specify different (physical and/or virtual) router as default "per protocol".

For example, router A propagates RA for IPv6, while router B propagates IPv4 configurations via DHCP.

In this case, I think IPv6 connections go to router A by default, while IPv4 connections go to router B by default.
I'm fairly sure that's the case. Although I'm not entirely sure what the point in doing so would be if it has to be on a IP version basis. The point is that anything have a default place that it's going to. For systems where there's more than one actual connection, that's where stuff like reverse proxies or drivers to provide failover to different network connections come into it.

My system operates on 2 different subnets, one for the system itself and another for my jails that get routed to via HA Proxy.
 
Although I'm not entirely sure what the point in doing so would be if it has to be on a IP version basis.
What I've imagine with this was something like situations below:
  • Contracted ISP B but no IPv6 connection is available, but no CG-NATs.
  • Want to use IPv6, so additionally contracted ISP B that does IPv6, considering to cancel ISP B once ISP A turns out to be good enough.
  • Turned out that ISP B provide IPv4 only via CG-NAT.
  • I don't want CG-NAT for my IPv4 connections with some reason.
  • Oh, how should I do?!
 
What I've imagine with this was something like situations below:
  • Contracted ISP B but no IPv6 connection is available, but no CG-NATs.
  • Want to use IPv6, so additionally contracted ISP B that does IPv6, considering to cancel ISP B once ISP A turns out to be good enough.
  • Turned out that ISP B provide IPv4 only via CG-NAT.
  • I don't want CG-NAT for my IPv4 connections with some reason.
  • Oh, how should I do?!
That's a different problem though, those are different net connections and you're probably better off using one of the tools for failover or separate vlans for that, or routing based on the type of traffic.

Doing it purely based on whether it's IPv4 or IPv6 is kind of a weird way of going about it and makes me think that there hasn't been enough planning involved.
 
That's a different problem though, those are different net connections and you're probably better off using one of the tools for failover or separate vlans for that, or routing based on the type of traffic.

Doing it purely based on whether it's IPv4 or IPv6 is kind of a weird way of going about it and makes me think that there hasn't been enough planning involved.
For (large enough) corporate users having enough network specialists in it, yes, of course.
But for SOHO or personal users that are NOT network specialists, it may be hard.
 
Back
Top