lagg interface

Eugene Grosbein eugen at grosbein.net
Mon Jan 6 17:11:39 UTC 2020


06.01.2020 22:46, Eugene Grosbein wrote:

> So, you need L3 traffic sharing. One example is using ipfw tables.
> For N external links (phones) you'd need (N-1) tables, one table for a link excluding first one.
> With two links, you need only one table listing clients using second link:
> 
> lan="10.0.0.0/8,192.168.0.0/16"
> ipfw disable one_pass
> ipfw table 1 add 10.0.10.200 # a client using second link
> ipfw table 1 add 192.168.0.5 # another client for second link
> 
> # translate incoming traffic
> ipfw delete 50
> ipfw add 50 nat 123 ip from any to any in recv ipheth0
> ipfw add 50 nat 123 ip from any to any in recv ipheth1

Correction: latest rule should use "nat 124" instead of "nat 123"
assuming there are two NAT instances configured each for its own link:
nat 123 for ipheth0, nat 124 for ipheth1.

> # insert your filtering rules between 50 and 50000
> 
> # translate and forward outgoing traffic
> # clients of second link processed later with rules 50110 etc.
> ipfw add 50000 skipto 50110 ip from not 'table(1)' to not $lan out
> 
> # other clients not mentioned in the table are NAT-ed and forwarded here
> ipfw add 50010 nat 123 ip from $lan to not $lan out
> ipfw add 50020 fwd $gw1 ip from $nat123_extip to any out
> 
> # clients using second link are NAT-ed and forwarded here
> ipfw add 50110 nat 124 ip from $lan to not $lan out
> ipfw add 50120 fwd $gw2 ip from $nat124_extip to any out



More information about the freebsd-net mailing list