Static IP for VPN client on ASUS

Need help configuring your VPN? Just post here and you'll get that help.
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
ahofr
OpenVpn Newbie
Posts: 3
Joined: Thu Feb 11, 2016 8:41 am

Static IP for VPN client on ASUS

Post by ahofr » Tue May 10, 2016 8:59 am

Hi Everyone,

I want to assign a static IP adres to a client on a ASUS router. Is that possible? I want to run script to the client and DNS is not working properly on a ASUS router and therefore not able to track the specific client.
If have tried "Manage Client-Specific Options" and edit the files and add --ifconfig-push but its not working.
Has anyone has any idea how to configure this or get it working?

Regards, ahofr

User avatar
Traffic
OpenVPN Protagonist
Posts: 4081
Joined: Sat Aug 09, 2014 11:24 am

Re: Static IP for VPN client on ASUS

Post by Traffic » Tue May 10, 2016 10:43 am

ahofr wrote:I want to assign a static IP adres to a client on a ASUS router. Is that possible?
What is the model number and operating system of the router ?

ahofr
OpenVpn Newbie
Posts: 3
Joined: Thu Feb 11, 2016 8:41 am

Re: Static IP for VPN client on ASUS

Post by ahofr » Fri May 13, 2016 12:45 pm

The model is a RT-AC87U and tried both original and ASUS-Merlin software code.

User avatar
Traffic
OpenVPN Protagonist
Posts: 4081
Joined: Sat Aug 09, 2014 11:24 am

Re: Static IP for VPN client on ASUS

Post by Traffic » Fri May 13, 2016 1:36 pm

In order to assign static IPs to clients use:
--client-config-dir directive in server config and --ifconfig-push in the client config file.

See those options in The Manual v23x

Also see this HOWTO:
HOWTO: Expanding the scope of the VPN to include additional machines

You may have to use a custom config on your router.

ahofr
OpenVpn Newbie
Posts: 3
Joined: Thu Feb 11, 2016 8:41 am

Re: Static IP for VPN client on ASUS

Post by ahofr » Thu May 19, 2016 10:56 am

Did you get it working? Because I was not able to get it working with ASUS-(Merlin) software code.
I already tried the commands already. The client config files are constantly overwritten by applying router changes and generate errors.

ekachaiz
OpenVpn Newbie
Posts: 6
Joined: Wed Apr 19, 2017 8:20 am

Re: Static IP for VPN client on ASUS

Post by ekachaiz » Wed Apr 19, 2017 8:25 am

Traffic wrote:In order to assign static IPs to clients use:
--client-config-dir directive in server config and --ifconfig-push in the client config file.

See those options in The Manual v23x

Also see this HOWTO:
HOWTO: Expanding the scope of the VPN to include additional machines

You may have to use a custom config on your router.
1. Im sorry to ask, how do i go about this on the Server Custom setting.
2. The config file that server create for client sort of combine everything into single .ovpn file. do I have to create CCD directory and another config file into the directory in client PC (windows)

User avatar
TinCanTech
OpenVPN Protagonist
Posts: 2808
Joined: Fri Jun 03, 2016 1:17 pm

Re: Static IP for VPN client on ASUS

Post by TinCanTech » Wed Apr 19, 2017 10:10 am

ekachaiz wrote:how do i go about this on the Server Custom setting
[VPN] How to set up the ASUSWRT for VPN Server – OpenVPN
ekachaiz wrote:do I have to create CCD directory and another config file into the directory in client PC (windows)
No .. on the Server

See --client-config-dir in The Manual v24x

ekachaiz
OpenVpn Newbie
Posts: 6
Joined: Wed Apr 19, 2017 8:20 am

Re: Static IP for VPN client on ASUS

Post by ekachaiz » Wed Apr 19, 2017 4:20 pm

TinCanTech wrote:
ekachaiz wrote:how do i go about this on the Server Custom setting
[VPN] How to set up the ASUSWRT for VPN Server – OpenVPN
ekachaiz wrote:do I have to create CCD directory and another config file into the directory in client PC (windows)
No .. on the Server

See --client-config-dir in The Manual v24x
Thank you for your reply

I manage to get into Server configuration file by using telnet to router. After i added client configuration file and try to connect, i receive this error "There is a problem in your selection of --ifconfig endpoints [local=192.168.10.7, remote=255.255.255.0]. The local and remote VPN endpoints must exist within the same 255.255.255.252 subnet." This probably something wrong with my subnet mask setting but what value i should be using?


Here's my current configuration:
file: config.ovpn

CODE
# Automatically generated configuration
daemon
server 192.168.10.1 255.255.255.0
proto udp
multihome
port 1194
dev tun21
cipher AES-256-CBC
comp-lzo adaptive
keepalive 15 60
verb 3
push "route 192.168.2.0 255.255.255.0 vpn_gateway 500"
client-config-dir /etc/server1/ccd >>>> my ccd folder location
client-to-client
duplicate-cn
plugin /usr/lib/openvpn-plugin-auth-pam.so openvpn
client-cert-not-required
username-as-common-name
ca ca.crt
dh dh.pem
cert server.crt
key server.key
status-version 2
status status 10


Here is my client configuration
file: ccd/user1

CODE
ifconfig-push 192.168.10.20 255.255.255.0

User avatar
TinCanTech
OpenVPN Protagonist
Posts: 2808
Joined: Fri Jun 03, 2016 1:17 pm

Re: Static IP for VPN client on ASUS

Post by TinCanTech » Wed Apr 19, 2017 4:30 pm

Add to your server config:

Code: Select all

topology subnet
See --topology in The Manual v24x

ekachaiz
OpenVpn Newbie
Posts: 6
Joined: Wed Apr 19, 2017 8:20 am

Re: Static IP for VPN client on ASUS

Post by ekachaiz » Wed Apr 19, 2017 5:10 pm

TinCanTech wrote:Add to your server config:

Code: Select all

topology subnet
See --topology in The Manual v24x
Thank you for your guidance TinCanTech!! got it, manage to assign to fix ip now using reference from your link
"Each pair of ifconfig-push addresses represent the virtual client and server IP endpoints. They must be taken from successive /30 subnets in order to be compatible with Windows clients and the TAP-Windows driver. Specifically, the last octet in the IP address of each endpoint pair must be taken from this set:

[ 1, 2] [ 5, 6] [ 9, 10] [ 13, 14] [ 17, 18]
[ 21, 22] [ 25, 26] [ 29, 30] [ 33, 34] [ 37, 38]
[ 41, 42] [ 45, 46] [ 49, 50] [ 53, 54] [ 57, 58]
[ 61, 62] [ 65, 66] [ 69, 70] [ 73, 74] [ 77, 78]
[ 81, 82] [ 85, 86] [ 89, 90] [ 93, 94] [ 97, 98]
[101,102] [105,106] [109,110] [113,114] [117,118]
[121,122] [125,126] [129,130] [133,134] [137,138]
[141,142] [145,146] [149,150] [153,154] [157,158]
[161,162] [165,166] [169,170] [173,174] [177,178]
[181,182] [185,186] [189,190] [193,194] [197,198]
[201,202] [205,206] [209,210] [213,214] [217,218]
[221,222] [225,226] [229,230] [233,234] [237,238]
[241,242] [245,246] [249,250] [253,254]"
now i can sleep peacefully :lol:

gama99
OpenVpn Newbie
Posts: 6
Joined: Tue Aug 08, 2017 6:36 am

Re: Static IP for VPN client on ASUS

Post by gama99 » Tue Sep 12, 2017 10:24 am

Hi guys! I will post in this thread don't want to open new one.
I have rt-ac88u with openvpn server here is configuration of the server i take it using putty throw ssh:

server 10.100.200.0 255.255.255.0
proto udp
multihome
port 33999
dev tun21
cipher AES-256-CBC
comp-lzo adaptive
keepalive 15 60
verb 3
push "route 192.168.199.0 255.255.255.0 vpn_gateway 500"
duplicate-cn
push "dhcp-option DNS 192.168.199.1"
tls-auth static.key 0
plugin /usr/lib/openvpn-plugin-auth-pam.so openvpn
client-cert-not-required
username-as-common-name
ca ca.crt
dh dh.pem
cert server.crt
key server.key
status-version 2
status status 10

I want to set up a static IP address for the client in Asus using stock firmware i hope it will work there is a custom configuration for the OpenVPN looks like this:

Image

Post Reply