Two Internet Gateways

Can anyone explain how I can use two Internet Gateways on a LAN. This is in a home environment.

I currently have a number of systems accessing the Internet via a pfSense router, but I want to test/configure a 4G router (Telkonika RUT955) which I'm setting up. Do I need to use separate networks to be able to have two gateways?
 
There's only one default gateway. How are you going to use that extra uplink? As a fall-back?

And note that we do not support pfSense here. Configuring pfSense is quite different compared to a standard FreeBSD install.
 
You'll need to implement a routing protocol like RIP or OSPF to use two or more gateways simultaneously. The Freebsd routed(8) daemon appears to provide support for RIP.

However if you want just a quick and dirty test, you can set your gateway to the test router and then set it back. For example on this system the default gateway is 192.168.1.1:
Code:
$ netstat -nr
Routing tables

Internet:
Destination        Gateway            Flags     Netif Expire
default            192.168.1.1         UGS        igb0
127.0.0.1          link#2             UH          lo0
192.168.1.0/24      link#1             U          igb0
192.168.1.157       link#1             UHS         lo0

I can delete that default using route delete default:
Code:
$ doas route delete default
delete net default
$ netstat -nr                                                  
Routing tables

Internet:
Destination        Gateway            Flags     Netif Expire
127.0.0.1          link#2             UH          lo0
192.168.1.0/24      link#1             U          igb0
192.168.1.157       link#1             UHS         lo0

Now I have no Internet access. Let's add the new gateway for testing:
Code:
$ doas route add default 192.168.1.2                            
add net default: gateway 192.168.1.2
$ netstat -nr                                                  
Routing tables

Internet:
Destination        Gateway            Flags     Netif Expire
default            192.168.1.2         UGS        igb0
127.0.0.1          link#2             UH          lo0
192.168.1.0/24      link#1             U          igb0
192.168.1.157       link#1             UHS         lo0

You would do the commands in reverse to restore your original default gateway:
Code:
doas route delete default
doas route add default 192.168.1.1
 
The Freebsd routed(8) daemon appears to provide support for RIP.
Don't use RIP. It's old and only supports classed IP ranges. Which means that 10.0.0.0 will always have a /8 netmask and 192.168.0.0 always a /16.
 
If you need to route over two or more different gateways on the internet you really need to use BGP. But most ISP's aren't going to support that on a 'consumer' grade internet connection.
 
@OP, what would you like to achieve?

For testing 4G, you can set default route on pfsense to 4G router, so you don't touch network setting on your client. Make sure that you set static routes of your internal network on 4G router to point to pfsense.


1638553807205.png
 
@OP, what would you like to achieve?

For testing 4G, you can set default route on pfsense to 4G router, so you don't touch network setting on your client. Make sure that you set static routes of your internal network on 4G router to point to pfsense.


View attachment 12211
I think I will initially set up the 4G router on a separate physical network until I know it functions properly and then connect it to my pfSense box, which is currently accessing the Internet via tethering from a phone.
 
Back
Top