Page 1 of 1

IP's on OpenWRT

Posted: Tue Jun 25, 2013 5:47 pm
by Wataru
Hello to all,

i've a very strange situation, configuring last OpenVpn on last OpenWRT (12.09)

got information at most from http://openvpn.net/index.php/open-sourc ... tml#server and http://wiki.openwrt.org/inbox/vpn.howto

and it works! but in very strange way:

i'm trying to give fixed ip to one client, and from some moment server gets NOT *.1 ip but *.5! and client gets ip neither i gave nor from dhcp range!

Here is server config (UCI), i'm using not bridged config:

Code: Select all

config openvpn 'lan'
		option 'enabled' '1'
		option 'port' '10536'
		option 'proto' 'udp'
		option 'dev' 'tun'
		option 'ca' '/etc/openvpn/ca.crt'
		option 'cert' '/etc/openvpn/server.crt'
		option 'key' '/etc/openvpn/server.key'
		option 'dh' '/etc/openvpn/dh1024.pem'
		option 'server' '10.0.0.0 255.255.255.0'
		#option 'mode' 'server'
		#option 'ifconfig' '10.0.0.1 255.255.255.0'
		#option 'ifconfig-pool' '10.0.0.2 10.0.0.5'
		option 'ifconfig-pool-persist' '/etc/config/ovpn_cl/ipp.txt'
		list 'push' 'route 192.168.1.0 255.255.255.240'
		list 'push' 'redirect-gateway'
		list 'push' 'dhcp-option DNS 10.0.0.1'
		option 'client_to_client' '1'
		option 'keepalive' '10 120'
		option 'max_clients' '3'
		option 'persist_key' '1'
		option 'persist_tun' '1'
		option 'status' '/tmp/openvpn-status.log'
		option 'verb' '6'
		#option 'client-config-dir' '/etc/config/ovpn_cl'

Re: IP's on OpenWRT

Posted: Thu Jun 27, 2013 8:57 am
by Wataru
Linux forums are the same ever...

Re: IP's on OpenWRT

Posted: Thu Jun 27, 2013 11:00 am
by Wataru
Hi Wataru,

i've had the same problem, and there are more same questions concerning another platforms (not only OpenWrt) in internet,

here http://www.linux.org.ru/forum/general/6091471 is for example one of solutions.

I really can not understand why we can't find it in OFFICIAL DOCUMENTATION or SAMPLE CONFIG... (

Re: IP's on OpenWRT

Posted: Thu Jun 27, 2013 11:03 am
by Wataru
Hi Wataru,

it works now, many thanks.

I think will be placed in OpenVPN FAQ or something.

P.S. It's really fun to chat with self xD

Re: IP's on OpenWRT

Posted: Thu Jun 27, 2013 11:38 am
by Wataru
But my main problem is still not solved:

clients did not get fixed ip's i'm giving them,
i've tried to use client-config-dir and ipp.txt, but all of my clients (2 winXPs and android) or maybe server itselft just ignoring all this settings.

Re: IP's on OpenWRT

Posted: Fri Jun 28, 2013 8:27 am
by Wataru
Looks like i had solved it, but in a very strange way.

Half of parameter do not work as they described in docs, and they are described 100500 different ways in many different manuals.

So, if you using UCI, you need this:
- DELETE (not comment) strings "ifconfig-pool" and all about "ccd" in server config file
- add " option 'topology' 'subnet' " to server config file
- add path to your ipp.txt, mine is '/etc/config/ccd/ipp.txt' , '/tmp/openvpn/ipp.txt' also worked
- delete ALL WRITE PREMISSIONS to ipp.txt. Parameter 0 in '/etc/config/ccd/ipp.txt 0' IS NOT WORKING, and openvpn wipes file at every start
- add you clients, like " client1,10.0.0.5 " without quotes, to ipp.txt
- restart openvpn