Okay.. Using the command:
ifconfig-push 172.16.100.10 255.255.255.0
in the CCD file has given the client a fixed IP address of 172.16.100.10 when it comes online and I am able to ping this address.
However the routing command (iroute) still does not work in the CCD file:
I have tried these permutations:
iroute 172.16.47.0 255.255.255.0
iroute 172.16.47.0 255.255.255.0 172.16.100.10
iroute 172.16.47.0 255.255.255.0 172.16.100.1
all to no avail.
This is my current setup now:
Server Config
--------------------------------------------
server 172.16.100.0 255.255.255.0
topology subnet
management 127.0.0.1 45678
ca ca.crt
key SCADAAPP1.key
cert SCADAAPP1.crt
dh dh1024.pem
proto udp
lport 5501
rport 5501
comp-lzo
cipher BF-CBC
tun-mtu 1500
ping 30
ping-restart 60
verb 3
dev tun
float
client-to-client
client-config-dir CCD
route-method exe
route-delay 2
CCD File
--------------------------------
ifconfig-push 172.16.100.10 255.255.255.0
iroute 172.16.47.0 255.255.255.0
#iroute 172.16.47.0 255.255.255.0 172.16.100.10
#iroute 172.16.47.0 255.255.255.0 172.16.100.1
Log File
--------------------------------
Thu May 24 11:58:13 2012 OpenVPN 2.2.2 Win32-MSVC++ [SSL] [LZO2] [PKCS11] built on Dec 15 2011
Thu May 24 11:58:13 2012 MANAGEMENT: TCP Socket listening on 127.0.0.1:45678
Thu May 24 11:58:13 2012 WARNING: --keepalive option is missing from server config
Thu May 24 11:58:13 2012 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Thu May 24 11:58:13 2012 Diffie-Hellman initialized with 1024 bit key
Thu May 24 11:58:13 2012 TLS-Auth MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Thu May 24 11:58:13 2012 Socket Buffers: R=[8192->8192] S=[8192->8192]
Thu May 24 11:58:13 2012 TAP-WIN32 device [Local Area Connection 4] opened: \\.\Global\{6299E4C3-7319-4401-BE7A-F98E2CE8AB25}.tap
Thu May 24 11:58:13 2012 TAP-Win32 Driver Version 9.9
Thu May 24 11:58:13 2012 TAP-Win32 MTU=1500
Thu May 24 11:58:13 2012 Set TAP-Win32 TUN subnet mode network/local/netmask = 172.16.100.0/172.16.100.1/255.255.255.0 [SUCCEEDED]
Thu May 24 11:58:13 2012 Notified TAP-Win32 driver to set a DHCP IP/netmask of 172.16.100.1/255.255.255.0 on interface {6299E4C3-7319-4401-BE7A-F98E2CE8AB25} [DHCP-serv: 172.16.100.254, lease-time: 31536000]
Thu May 24 11:58:13 2012 Sleeping for 2 seconds...
Thu May 24 11:58:15 2012 Successful ARP Flush on interface [131074] {6299E4C3-7319-4401-BE7A-F98E2CE8AB25}
Thu May 24 11:58:15 2012 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Thu May 24 11:58:15 2012 UDPv4 link local (bound): [undef]:5501
Thu May 24 11:58:15 2012 UDPv4 link remote: [undef]
Thu May 24 11:58:15 2012 MULTI: multi_init called, r=256 v=256
Thu May 24 11:58:15 2012 IFCONFIG POOL: base=172.16.100.2 size=252
Thu May 24 11:58:15 2012 Initialization Sequence Completed
Thu May 24 11:59:06 2012 MULTI: multi_create_instance called
Thu May 24 11:59:06 2012 10.112.202.166:3075 Re-using SSL/TLS context
Thu May 24 11:59:06 2012 10.112.202.166:3075 LZO compression initialized
Thu May 24 11:59:06 2012 10.112.202.166:3075 Control Channel MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Thu May 24 11:59:06 2012 10.112.202.166:3075 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Thu May 24 11:59:06 2012 10.112.202.166:3075 Local Options hash (VER=V4): '530fdded'
Thu May 24 11:59:06 2012 10.112.202.166:3075 Expected Remote Options hash (VER=V4): '41690919'
Thu May 24 11:59:06 2012 10.112.202.166:3075 TLS: Initial packet from 10.112.202.166:3075, sid=f2e47ae7 d94e838e
Thu May 24 11:59:13 2012 10.112.202.166:3075 VERIFY OK: depth=1, /C=UK/ST=Hatton/L=Warwickshire/O=companyname/OU=SCADA/CN=SCADAAPP1/emailAddress=
scadateam@companyname.co.uk
Thu May 24 11:59:13 2012 10.112.202.166:3075 VERIFY OK: depth=0, /C=UK/ST=Hatton/O=companyname/CN=CityMillsLock/emailAddress=
scadateam@companyname.co.uk
Thu May 24 11:59:13 2012 10.112.202.166:3075 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Thu May 24 11:59:13 2012 10.112.202.166:3075 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Thu May 24 11:59:13 2012 10.112.202.166:3075 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Thu May 24 11:59:13 2012 10.112.202.166:3075 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Thu May 24 11:59:14 2012 10.112.202.166:3075 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA
Thu May 24 11:59:14 2012 10.112.202.166:3075 [CityMillsLock] Peer Connection Initiated with 10.112.202.166:3075
Thu May 24 11:59:14 2012 CityMillsLock/10.112.202.166:3075 OPTIONS IMPORT: reading client specific options from: CCD\CityMillsLock
Thu May 24 11:59:14 2012 CityMillsLock/10.112.202.166:3075 MULTI: Learn: 172.16.100.10 -> CityMillsLock/10.112.202.166:3075
Thu May 24 11:59:14 2012 CityMillsLock/10.112.202.166:3075 MULTI: primary virtual IP for CityMillsLock/10.112.202.166:3075: 172.16.100.10
Thu May 24 11:59:14 2012 CityMillsLock/10.112.202.166:3075 MULTI: internal route 172.16.47.0/24 -> CityMillsLock/10.112.202.166:3075
Thu May 24 11:59:14 2012 CityMillsLock/10.112.202.166:3075 MULTI: Learn: 172.16.47.0/24 -> CityMillsLock/10.112.202.166:3075
Thu May 24 11:59:15 2012 CityMillsLock/10.112.202.166:3075 PUSH: Received control message: 'PUSH_REQUEST'
Thu May 24 11:59:15 2012 CityMillsLock/10.112.202.166:3075 SENT CONTROL [CityMillsLock]: 'PUSH_REPLY,route-gateway 172.16.100.1,topology subnet,ifconfig 172.16.100.10 255.255.255.0' (status=1)
You asked for a netstat -nr. Here is the results of the command from the server
netstat from server
----------------------------------------
IPv4 Route Table
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x10004 ...00 11 43 d7 24 62 ...... Intel(R) PRO/1000 MT Network Connection
0x20002 ...00 ff 62 99 e4 c3 ...... TAP-Win32 Adapter V9
===========================================================================
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 10.97.10.1 10.97.200.2 10
10.17.1.239 255.255.255.255 10.97.10.25 10.97.200.2 1
10.17.1.240 255.255.255.255 10.97.10.25 10.97.200.2 1
10.17.10.11 255.255.255.255 10.97.10.25 10.97.200.2 1
10.97.0.0 255.255.0.0 10.97.200.2 10.97.200.2 10
10.97.200.2 255.255.255.255 127.0.0.1 127.0.0.1 10
10.109.50.136 255.255.255.255 10.97.10.25 10.97.200.2 1
10.109.50.145 255.255.255.255 10.97.10.25 10.97.200.2 1
10.109.50.146 255.255.255.255 10.97.10.25 10.97.200.2 1
10.109.50.147 255.255.255.255 10.97.10.25 10.97.200.2 1
10.109.50.148 255.255.255.255 10.97.10.25 10.97.200.2 1
10.109.50.167 255.255.255.255 10.97.10.25 10.97.200.2 1
10.109.50.179 255.255.255.255 10.97.10.25 10.97.200.2 1
10.109.50.181 255.255.255.255 10.97.10.25 10.97.200.2 1
10.109.50.200 255.255.255.255 10.97.10.25 10.97.200.2 1
10.109.200.2 255.255.255.255 10.97.10.25 10.97.200.2 1
10.109.200.3 255.255.255.255 10.97.10.25 10.97.200.2 1
10.109.200.20 255.255.255.255 10.97.10.25 10.97.200.2 1
10.109.200.21 255.255.255.255 10.97.10.25 10.97.200.2 1
10.109.200.72 255.255.255.255 10.97.10.25 10.97.200.2 1
10.255.255.255 255.255.255.255 10.97.200.2 10.97.200.2 10
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
172.16.8.2 255.255.255.255 10.97.10.25 10.97.200.2 1
172.16.9.2 255.255.255.255 10.97.10.25 10.97.200.2 1
172.16.15.2 255.255.255.255 10.97.10.25 10.97.200.2 1
172.16.16.2 255.255.255.255 10.97.10.25 10.97.200.2 1
172.16.18.2 255.255.255.255 10.97.10.25 10.97.200.2 1
172.16.36.2 255.255.255.255 10.97.10.25 10.97.200.2 1
172.16.37.2 255.255.255.255 10.97.10.25 10.97.200.2 1
172.16.39.2 255.255.255.255 10.97.10.25 10.97.200.2 1
172.16.40.2 255.255.255.255 10.97.10.25 10.97.200.2 1
172.16.41.2 255.255.255.255 10.97.10.25 10.97.200.2 1
172.16.42.2 255.255.255.255 10.97.10.25 10.97.200.2 1
172.16.43.2 255.255.255.255 10.97.10.25 10.97.200.2 1
172.16.46.2 255.255.255.255 10.97.10.25 10.97.200.2 1
172.16.47.2 255.255.255.255 10.97.10.25 10.97.200.2 1
172.16.51.2 255.255.255.255 10.97.10.25 10.97.200.2 1
172.16.54.2 255.255.255.255 10.97.10.25 10.97.200.2 1
172.16.100.0 255.255.255.0 172.16.100.1 172.16.100.1 30
172.16.100.1 255.255.255.255 127.0.0.1 127.0.0.1 30
172.16.255.255 255.255.255.255 172.16.100.1 172.16.100.1 30
224.0.0.0 240.0.0.0 10.97.200.2 10.97.200.2 10
224.0.0.0 240.0.0.0 172.16.100.1 172.16.100.1 30
255.255.255.255 255.255.255.255 10.97.200.2 10.97.200.2 1
255.255.255.255 255.255.255.255 172.16.100.1 172.16.100.1 1
Default Gateway: 10.97.10.1
===========================================================================
Persistent Routes:
None
Unfortunatly the client is not a windows machine. Even though I can log onto the modem I dont think I am able to issue a netstat command from there.
So just to recap. We are now able to get a fixed IP for our devices but are unable to access the subnet behind that device.
In the above client we are giving it an iroute of 172.16.47.0. I would expect to be able to access:
172.16.47.1
172.16.47.2
172.16.47.X - etc
One thing I did do was to add the following route to the server config:
route 172.16.47.0 255.255.0.0 172.16.100.10
The thinking there to direct any traffic to 172.16.47.X to the gateway 172.16.100.10 which is what the client comes online with now but that gives us an error in the log when I try that:
Thu May 24 12:09:26 2012 C:\WINDOWS\system32\route.exe ADD 172.16.47.0 MASK 255.255.0.0 172.16.100.10
The route addition failed: The specified mask parameter is invalid. (Destination & Mask) != Destination.