danielzzz / node-ping

a poor man's ping library (using udp scanning) for node
MIT License
332 stars 105 forks source link

Multiple interface on debian #137

Closed victorbillaud closed 2 years ago

victorbillaud commented 3 years ago

Hello, I have a little problem, my server have 2 differents ip, one for internet connexion and one for local network with robots. On my server i have two network interfaces. It's possible to specifie the good interface in ping request ?

mondwan commented 3 years ago

Depends on your platform, you can specify custom option.

For example, Linux one, you can use -I eth1

Ping 8.8.8.8 -I eth1

在 2021年4月23日週五 20:04,victorbillaud @.***> 寫道:

Hello, I have a little problem, my server have 2 differents ip, one for internet connexion and one for local network with robots. On my server i have two network interfaces. It's possible to specifie the good interface in ping request ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/danielzzz/node-ping/issues/137, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5YBI4RGP5UUK7UHZASCDDTKFO5VANCNFSM43OQOJGA .

victorbillaud commented 3 years ago

I spoke about npm ping with node js

mondwan commented 3 years ago

Since our module relies underlying ping command in your platform, as long as your platform support ping by interface, we support that.

For example, in linux, you can ping with specific interface by using option -I

Therefore, you can specific that ["-I", "eth1"] via "extra" option as illustrated in an example "configurable ping option "

在 2021年4月24日週六 00:35,victorbillaud @.***> 寫道:

I spoke about npm ping with node js

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/danielzzz/node-ping/issues/137#issuecomment-825776923, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5YBI2BHAGJSCWEQ7JWCQ3TKGOTRANCNFSM43OQOJGA .

mondwan commented 3 years ago

In debian system, I believe {..., extra: ['-I', 'THAT_INTERFACE']} should do the trick

victorbillaud commented 3 years ago

Oh thanks for this answer, i will try this monday. Have a nice evening