clowwindy / ShadowVPN

Removed according to regulations.
1.47k stars 1.06k forks source link

Add `local_ip`, `remote_ip`, and `netmask` to config file #125

Closed riobard closed 9 years ago

riobard commented 9 years ago

In addition to existing keys, we should add the following three (optional?) keys to config file

# client.conf or server.conf 
local_ip=10.7.0.0
remote_ip=10.7.0.1
netmask=255.255.255.254

So that client_up.sh and server_up.sh can refer to those keys like this

# server_up.sh or client_up.sh
ifconfig $intf $local_ip netmask $netmask mtu $mtu

Then multiple instances of ShadowVPN clients/servers can share the same pair of up/down scripts.

70599 commented 9 years ago

支持。 最好luci-app也能对应一下。

cpktpoetkxwz commented 9 years ago

直接修改conf和scripts就可以了,luci-app只需要加一个选项并修改一下init script,shadowvpn的源码不需要做修改(只是启动时会提示"warning: unknown key in config file: %s", key)

clowwindy commented 9 years ago

Actually we can do this in current version. Because shadowvpn simply passes all the key value pairs to the shell script.

riobard commented 9 years ago

@clowwindy Ah! My bad. I was confused by the warnings generated by https://github.com/clowwindy/ShadowVPN/blob/master/src/args.c#L184 and thought it didn't allow me to do so (despite the comments in the sample shell scripts).

If this is the intended behavior, is there any plan to get rid of that warning message?

clowwindy commented 9 years ago

The message still helps users find typos. Maybe we could use the following:

warning: config key XXX not recognized by shadowvpn, will be passed to shell scripts anyway
riobard commented 9 years ago

That would be nice :)