ntop / n2n

Peer-to-peer VPN
GNU General Public License v3.0
6.19k stars 934 forks source link

Make edge automatically read edge.conf if no option is given #165

Closed jakeecn closed 5 years ago

jakeecn commented 5 years ago

The edge.conf file cannot be read, edge for windows?

jakeecn commented 5 years ago

When running edge.exe, it is determined that if there is edge.conf in the program directory, it will be read automatically, and the version information will be displayed if there is no edge.conf in the program directory.

emanuele-f commented 5 years ago

Please try "edge.exe edge.conf" after fix in 9cc2aee7fc232b4b393be8f0c91806da4fd61000

jakeecn commented 5 years ago

Thank you! 1、Can you enable the running edge.exe to automatically read the edge.conf by default? 2、Whether registration as a windows service can be implemented?

lucktu commented 5 years ago

Yes, it can read edge.conf. However, the version number will not change? 2.5.0

jakeecn commented 5 years ago

D:\software\Remote\n2n>edge.exe Welcome to n2n v.2.5.1 for Windows Built on Jul 8 2019 23:18:29 Copyright 2007-19 - ntop.org and contributors

edge (see edge.conf) or edge -d -a [static:|dhcp:] -c [-k <encr ypt key>] [-s ] [-m ] -l [-p ] [-M ] [-r] [-E] [-v] [-i ] [-t <mgmt po rt>] [-b] [-A] [-h]

-d | tun device name -a | Set interface address. For DHCP use '-r -a dhcp:0.0.0 .0' -c | n2n community name the edge belongs to. -k | Encryption key (ASCII) - also N2N_KEY=. -s | Edge interface netmask in dotted decimal notation (25 5.255.255.0). -l | Supernode IP:port -i | Registration interval, for NAT hole punching (default 20 seconds) -b | Periodically resolve supernode IP | (when supernodes are running on dynamic IPs) -p | Fixed local UDP port. -m | Fix MAC address for the TAP interface (otherwise it m ay be random) | eg. -m 01:02:03:04:05:06 -M | Specify n2n MTU of edge interface (default 1400). -r | Enable packet forwarding through n2n community. -A | Use AES CBC for encryption (default=use twofish). -E | Accept multicast MAC addresses (default=drop). -v | Make more verbose. Repeat as required. -t | Management UDP Port (for multiple edges on a machine) .

Environment variables: N2N_KEY | Encryption key (ASCII). Not with -k.

Running edge.exe does not read the configuration file [edge.conf] by default?

jakeecn commented 5 years ago

D:\software\Remote\n2n 2019-07-08 23:30

. 2019-07-08 23:30 .. 2019-07-08 17:22 52 edge.bat 2019-07-08 23:32 1,063 edge.conf 2019-07-08 23:18 420,626 edge.exe

lucktu commented 5 years ago

OK, I see. Very good! It's for my compiler. Run edge, display help. ^_^

emanuele-f commented 5 years ago

I've changed the title. In essence this is useful in Windows because it makes it easy to run edge without an additional edge.bat script. However, maybe this behavior should be common between linux and windows. A pull request for windows is already provided in #166

jakeecn commented 5 years ago

Thank you so much!

emanuele-f commented 5 years ago

Implemented in 0b965c37c0e2b98f2b14592bdfc6e7f68bf8ac4b