how to set default route on multihome

Tom H tomh0665 at gmail.com
Fri Jan 24 19:15:20 UTC 2020


On Fri, Jan 24, 2020 at 7:19 PM Mike Wright <nobody at nospam.hostisimo.com> wrote:
> On 1/24/20 9:54 AM, sean darcy wrote:
>>
>> I'm trying to set up a dmz between my internal network and the router.
>> Interface A for internal, interface B for the router. How do I make sure
>> the default route is set to interface B ?
>
> I can give you the manual method for ipv4.
>
> For traffic to cross between the two interfaces forwarding must be
> enabled.  That is done in sysctl.conf
>
> net.ipv4.ip_forward=1
>
> Then the default route is assigned to the router interface:
>
> ip route add default via <gateway_ip> dev <router_interface>

It's better to enable forwarding for the NIC that needs it

/proc/sys/net/ipv4/conf/<NIC>/forwarding
/proc/sys/net/ipv6/conf/<NIC>/forwarding

so

net.ipv4.conf.<NIC>.forwarding = 1
net.ipv6.conf.<NIC>.forwarding = 1




More information about the ubuntu-users mailing list