Closed audibleblink closed 4 years ago
@audibleblink first of all, thanks 🙇 for this pull request. It's a good idea 💡
Before I'm ready to merge it, I want to discuss some options with you and @bcoles.
@audibleblink 's pull request lets someone select the IP address.
I'm in favour of interface or bind address, assuming the former will be more popular.
Some examples from other popular tools are:
curl
--interface <name> Use network INTERFACE (or address)
nmap
-e <iface>: Use specified interface
ncat
-p, --source-port port Specify source port to use -s, --source addr Specify source address to use (doesn't affect -l)
wget
--bind-address=ADDRESS bind to ADDRESS (hostname or IP) on local host
The $local_port gets set to 61000. Why did you set this and did it cause problems if left as nil? The ideal situation would be for the local port to be whatever the OS chooses, even when selecting an interface or bind IP address.
when '-b', '--bind'
$local_host = arg
$local_port = 61000
This could be useful for bypassing mis-configured firewalls.
nmap
-g/--source-port <portnum>: Use given port number
ncat
-p, --source-port port Specify source port to use
require 'socket'
Socket.ip_address_list
I like this idea.
Before I'm ready to merge it, I want to discuss some options with you and @bcoles.
In regards to command line convention, I'm in favor of -I
/ --interface
if the interfacecan be specified by name (ie, eth0
).
If using the adapter name isn't easy/possible, then --bind
or --source
seem more appropriate, as these imply an address.
The $local_port gets set to 61000. Why did you set this and did it cause problems if left as nil?
I, too, would like to see the hard-coded port removed, if possible.
@bcoles and @audibleblink I'm working on it on the bind-interface branch.
Currently working on the interface validation
Hi @audibleblink, did this patch work for you, and if so what OS are you using?
hey all. thanks for looking at this. currently dealing with a 3 day power outage, a newborn, and in-laws. will be a bit before I can add anything here.
--interface
tests under Linux successfully send the traffic through the correct network interface.
--interface
tests under macOS fail. Everything "just works"
--source-port
under Linux with 1 thread, fails with source port reuse problems.
--source-port
under Linux even fails with source port reuse problems, even when using --wait
--source-port
under macOS fails with source port reuse problems.
--source-port
under Linux only works when --source-address
(or --interface) is also specified.
does the firmware in devies prevent this
Attempt at implementing #302