how to get ifconfig-push from client-connect
Posted: Fri Nov 05, 2010 7:54 am
I'm running openvpn-2.1.1 on fedora 13. I have a custom client-connect shell script which is supposed to generate ip addresses for clients. It works ok. But how do I pass generated ip back to daemon? The manual says "If the script wants to generate a dynamic config file to be applied on the server when the client connects, it should write it to the file named by $1.". So essentially I do at the end of the script. This results in
Code: Select all
echo "ifconfig-push $server_virtual_ip $client_virtual_ip" > $1
I added 'cd /opt/scripts/openvpn' and chowned this dir to nobody:nobody, but still no go. What else do I do?/opt/scripts/openvpn/10.client-connect.sh: line 26: openvpn_cc_2d513fe0c128eba25815d8080769e959.tmp: Permission denied
Code: Select all
local xx.xx.xx.xx
port 33333
proto udp
dev tun
ca /etc/ca/keys/qwerty-ca.crt
cert /etc/ca/keys/qwerty-s.crt
key /etc/ca/keys/qwerty-s.key
dh /etc/ca/keys/dh2048.pem
server 10.10.10.0 255.255.255.0
duplicate-cn
push "redirect-gateway"
comp-lzo
max-clients 100
user nobody
group nobody
persist-key
persist-tun
status /var/log/openvpn/10.status 120
log-append /var/log/openvpn/10.log
verb 4
mute 10
no-replay
client-connect /opt/scripts/openvpn/10.client-connect.sh
nice -5
cd /opt/scripts/openvpn
Code: Select all
# ll /opt/scripts/ | grep openvpn
drwxr-xr-x 2 nobody nobody 4096 Nov 4 22:16 openvpn