[Nagiosplug-devel] feature request - selecting yournetwork interface

Andreas Ericsson ae at op5.se
Fri Sep 29 17:30:26 CEST 2006


Thomas Guyot-Sionnest wrote:
> 
> Using Linux VLAN support I'd like to be able to have one IP per VLAN and
> check all interconectivity between vlans and other sites. So for example I
> may want to know if hosts in the .7 vlan can connect to the mail server in
> the .4 vlan, but since I have an IP in the .4 vlan already it won't go
> trough the firewall. So I must specify to sent it from the .7 vlan.
> 

Ah. This makes your request make sense. If you wish for the outbound 
traffic to go through a specific interface, that's very easy to fix. You 
just need to bind(2) the socket to an IP specified by the user prior to 
calling connect(2) on it. The IP ofcourse have to exist and be 
associated with the interface you want to use for the outbound traffic.

Provided you don't have two interfaces with the same IP (which would 
indeed be completely insane), this will work magnificently while 
avoiding the portability problems associated with finding a specific 
interface (have a look at check_dhcp for some true portability horror).

Happy hacking, and make sure you send in the patch when you're done.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231




More information about the Devel mailing list