问题原文
原帖链接 · Iwaneez · CC BY-SA 4.0
I have asus router RT-AC58U (fw 3.0.0.4.382_51899) and have successfully set up OpenVPN. Here are my custom settings: OpenVPN custom settings
these setting automatically generate file
config.ovpn
# Automatically generated configuration
# Tunnel options
proto udp
multihome
port 1194
dev tun21
sndbuf 0
rcvbuf 0
keepalive 15 60
daemon vpnserver1
verb 3
status-version 2
status status 10
comp-lzo adaptive
plugin /usr/lib/openvpn-plugin-auth-pam.so openvpn
# Server Mode
server 10.8.0.0 255.255.255.0
client-config-dir ccd
client-to-client
duplicate-cn
route 10.8.0.8 255.255.255.128
push "route 192.168.1.0 255.255.255.0 vpn_gateway 500"
push "redirect-gateway def1"
push "dhcp-option DNS 192.168.1.1"
# Data Channel Encryption Options
auth SHA1
# TLS Mode Options
ca ca.crt
dh dh.pem
cert server.crt
key server.key
# Custom Configuration
I know it is possible to to create file in ccd directory with
ifconfig-push ip mask
but I cannot create them manually, everything is generated. I can enable client specific options and add clients throught ui, which generates ccd directory with client files, but the generated content looks like this:
iroute 10.8.0.8 255.255.255.128
Is it possible to assign VPN clients static IP addresses?
I also have only one client.ovpn possible to export which has always the same CN == client
已采纳解答
原帖链接 · Iwaneez · CC BY-SA 4.0
I managed to make it work by applying following steps:
- You need to activate ssh access to your router (+ setup username and password)
- Login to your router
ssh username@routerIp - There is a writable directory
/jffs. Create some config structure under it e.g./jffs/configs/openvpn/ccd(usemkdir) - In
ccddir create file with same name as your vpn client username (e.g.touch nuc) - Write config for your client in this file (
vi nuc) - Write your client's config there using format
ifconfig-push staticIP mask(e.g.ifconfig-push 10.0.8.10 255.255.255.0) and save - Leave secure shell (
exit) - Log into your router's ui, go to OpenVpn setup menu and fill the path to your client config into
"Custom Configuration"field:client-config-dir /jffs/configs/openvpn/ccdAlso don't forget to switchUsername / Password Auth. Onlyto"Yes"(otherwise client config files should be named by client's CN) - Save router config clicking on
Applybutton
Now you can connect with vpn client and you will get the set up IP (mine was 10.0.8.10)
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
