Add default Gateway on different subnet FreeBSD / Linux


two days a go i got new VPS (FreeBSD 11) , the IP was  “213.202.XxX.XX.x/32” subnet and my GW i was given was in a different subnet “89.16X.XxX.1”.

So here is how to add 213.202.XxX.XX.x/32 and a different GW on your Linux / BSD host:

##first add your gateway with subnet , then add the default

## on FreeBSD :

#route add 89.16X.XxX.1/32 -iface em0 

#route add default 89.16X.XxX.1

## on Linux :

#route add 89.16X.XxX.1/32 dev eth0
#route add default gw 89.16X.XxX.1

Leave a Reply

Your email address will not be published. Required fields are marked *