kern/146394: [vlan] IP source address for outgoing connections

julian at FreeBSD.org julian at FreeBSD.org
Sat May 8 17:05:03 UTC 2010


Synopsis: [vlan] IP source address for outgoing connections

State-Changed-From-To: open->feedback
State-Changed-By: julian
State-Changed-When: Sat May 8 09:47:30 PDT 2010
State-Changed-Why: 
The behaviour you quote as a bug is expected and useful and I don't think it is a bug.
Any non-bound socket will 'bind' itself to the address of the interface through which the 
outgoing packet will leave. If you do not do this there is no guarantee that the
client will be able to get to the responding address as it may be on a differnet network.

Anyhow there are ways to do what you want.
firstly: what you are talking about will ONLY happen if you do not bind the
socke to an address, so looking in the config file and binding it will 
fix it. Most programs have an option to do this. I had to do this yesterday with named.
(though I didn't find such an option in ntpd).
You need to look at what is going on using sockstat and netstat -aAn
any socket that has a local address of "*" will have this behaviour.

If you can't do this then you can use the jail command to force a program that
does not support binding to be bound.
Put it in a jail that has the same root as the rest of the system
but has a forced IP address of that you want.

Let me know if this solved your problem an dwe can close the bug.




http://www.freebsd.org/cgi/query-pr.cgi?pr=146394


More information about the freebsd-net mailing list