歡迎您光臨本站 註冊首頁

OPENVPN 分配固定IP

←手機掃碼閱讀     火星人 @ 2014-03-22 , reply:0

小弟剛配置了OPENVPN能正常運行(證書認證與radius用戶名與密碼方式認證)現要給客戶配置固定IP
在證書認證方式下配置的固定IP正常,都能取到所配置的IP,用戶服務名與密碼方式認證就分配不到配置的IP

服務端配置中已加入
username-as-common-name

以下是服務端配置

local 192.168.1.20
port 1194
proto tcp

dev tun

ca /root/openvpn-2.1.1/easy-rsa/2.0/keys/ca.crt
cert /root/openvpn-2.1.1/easy-rsa/2.0/keys/server.crt
key /root/openvpn-2.1.1/easy-rsa/2.0/keys/server.key
dh /root/openvpn-2.1.1/easy-rsa/2.0/keys/dh1024.pem
client-config-dir /usr/local/etc/ccd
#route 10.9.0.0 255.255.255.252

#ifconfig-pool-persist /usr/local/etc/ipp.txt

server 10.8.0.0 255.255.255.0

client-to-client
keepalive 10 120

duplicate-cn
comp-lzo

persist-key
persist-tun
status /root/openvpn-2.1.1/easy-rsa/2.0/keys/openvpn-status.log
verb 4



push "dhcp-option DNS 218.85.157.99"

plugin /usr/local/etc/radiusplugin.so /usr/local/etc/radiusplugin.conf

client-cert-not-required

username-as-common-name


CCD下client2配置
ifconfig-push 10.9.0.1 10.9.0.2

客戶端配置:
client
dev tun
proto tcp
remote 192.168.1.20 1194
persist-key
persist-tun
ca /usr/local/etc/ca.crt
#cert /usr/local/etc/keys/client2.crt
#key /usr/local/etc/keys/client2.key
auth-user-pass /usr/local/etc/user.conf
ns-cert-type server
comp-lzo
verb 3
redirect-gateway def1
status /usr/local/etc/openvpn-status.log



難道固定IP只能在證書方式下才能配置么

[火星人 ] OPENVPN 分配固定IP已經有1472次圍觀

http://coctec.com/docs/linux/show-post-105159.html