Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "source_ip" field should also support an interface name #76

Open
pprindeville opened this issue Sep 1, 2023 · 4 comments
Open

The "source_ip" field should also support an interface name #76

pprindeville opened this issue Sep 1, 2023 · 4 comments

Comments

@pprindeville
Copy link

Many network utilities (ping, ssh, traceroute, etc) will take an interface name to signify the source address, and then query the interface for its list of addresses and use the first of the appropriate address family.

This is handy when you want to source packets from an interface with a dynamic address (such as an IPsec/GRE tunnel or a DHCP'd subnet) but don't want to be editing the configuration file on-the-fly.

@pprindeville
Copy link
Author

I'm willing to write the code myself (though I can only easily test on Linux) but don't want to start the effort if it's already known that the feature won't be accepted...

@alandekok
Copy link
Member

alandekok commented Sep 1, 2023 via email

@pprindeville
Copy link
Author

Well, yes, you could name your host eth0 but how often does that happen? You could ioctl(SIOCGIFADDR) on the name first, and if that fails, do a gethostbyname() on it instead.

@alandekok
Copy link
Member

It's not about how often it happens, it's about doing things clearly and correctly so that we know the software is correct.

It costs essentially nothing to add another configuration parameter. The code could look for source_interface, and if found use that. If not found, use source_ip.

This is not really any more code than looking up the interface by name, and if not found, looking the name up as a hostname.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants