Issue with forwarding when creates new interface [was USB Tethering and forwarding]

Paul Thornton prt at prt.org
Sat Jan 3 18:57:11 UTC 2015


Hi,

On 03/01/2015 18:06, Mike Tancsa wrote:

> do you set forwarding via just /etc/sysctl.conf or in /etc/rc.conf via
> ipv6_gateway_enable and gateway_enable. I seem to recall some discussion
> about there being a difference.  Perhaps devd is calling something that
> then fiddles with the setting ignoring whats in sysctl.conf ?

That seems to be what is happening.

In the earlier post, I was just setting the three sysctls in 
/etc/sysctl.conf - and observed that forwarding went away if an 
interface was added.

Doing it by setting fastforwarding only in sysctl.conf, and setting both 
gateway_enables to yes in rc.conf fixes the problem:

[root at test1 ~]# sysctl -a | grep forwarding
net.inet.ip.forwarding: 1
net.inet.ip.fastforwarding: 1
net.inet6.ip6.forwarding: 1

[root at test1 ~]# ifconfig vlan1 create

[root at test1 ~]# sysctl -a | grep forwarding
net.inet.ip.forwarding: 1
net.inet.ip.fastforwarding: 1
net.inet6.ip6.forwarding: 1

That's quite ... odd, to sat the least.  I can't see anything in 
devd.conf which would relate to a new interface being created, but that 
doesn't mean that there isn't some magic functionality in there.

Paul.


More information about the freebsd-net mailing list