Hi Everyone,
I have a Virtual Machine (a XEN VM I think) with CentOS installed. The VM provider has given me two public IPs, primary one configured on eth0 and secondary I can use but both of them are for VM's WAN side (not routed). I've configured the Server successfully and can dial from the client (windows based); authentication is handled by freeradius on the server. I get the secondary IP on my client machine with proper default route but the traffic doesn't go out, even the gateway address doesn't respond. The problem I suspect is that the secondary IP provided is to be used on the WAN side, not on the LAN side (virtually LAN side actually - on tap interface). Following are the server / client configs; along with some routes etc. Need help on how can I bridge the tap0 and eth0 interfaces once the VPN is established; so that I can ping the default gateway of secondary IP over the VPN. Which is most certainly lying on the next hop of my VM (maybe the host Server of the provider). Given below is some helping data on my setup:
*******************
Server.conf
*******************
port 1194 #- port
proto udp #- protocol
dev tap0
mode server
tls-server
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
reneg-sec 0
ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt
cert /etc/openvpn/easy-rsa/2.0/keys/server.crt
key /etc/openvpn/easy-rsa/2.0/keys/server.key
dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem
plugin /etc/openvpn/radiusplugin.so /etc/openvpn/radiusplugin.cnf #- Uncomment this line if you are using FreeRADIUS
client-cert-not-required
username-as-common-name
server-bridge GHI.JKL.22.1 255.255.255.128 GHI.JKL.22.109 GHI.JKL.22.109
push "redirect-gateway"
keepalive 10 60
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
keepalive 5 30
comp-lzo
persist-key
persist-tun
status 1194.log
verb 3
*******************
Client.conf
*******************
client
tls-client
dev tap
proto udp
remote ABC.DEF.213.117 1194 # - Your server IP and OpenVPN Port
resolv-retry infinite
nobind
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
persist-key
persist-tun
ca ca.crt
auth-user-pass
comp-lzo
reneg-sec 0
verb 3
pull
route-method exe
route-delay 2
*******************
Client Log
*******************
Fri Sep 06 15:20:11 2013 OpenVPN 2.0.9 Win32-MinGW [SSL] [LZO] built on Oct 1 2006
Fri Sep 06 15:20:21 2013 IMPORTANT: OpenVPN's default port number is now 1194, based on an official port number assignment by IANA. OpenVPN 2.0-beta16 and earlier used 5000 as the default port.
Fri Sep 06 15:20:21 2013 WARNING: No server certificate verification method has been enabled. See
http://openvpn.net/howto.html#mitm for more info.
Fri Sep 06 15:20:21 2013 LZO compression initialized
Fri Sep 06 15:20:21 2013 Control Channel MTU parms [ L:1574 D:138 EF:38 EB:0 ET:0 EL:0 ]
Fri Sep 06 15:20:21 2013 Data Channel MTU parms [ L:1574 D:1450 EF:42 EB:135 ET:32 EL:0 AF:3/1 ]
Fri Sep 06 15:20:21 2013 Local Options hash (VER=V4): 'd79ca330'
Fri Sep 06 15:20:21 2013 Expected Remote Options hash (VER=V4): 'f7df56b8'
Fri Sep 06 15:20:21 2013 UDPv4 link local: [undef]
Fri Sep 06 15:20:21 2013 UDPv4 link remote: ABC.DEF.213.117:1194
Fri Sep 06 15:20:21 2013 TLS: Initial packet from ABC.DEF.213.117:1194, sid=6b6efd97 4a64ae76
Fri Sep 06 15:20:23 2013 VERIFY OK: depth=1, /C=US/ST=CA/L=SanFrancisco/O=Fort-Funston/OU=changeme/CN=vps008/name=changeme/emailAddress=
xyz@gmail.com
Fri Sep 06 15:20:23 2013 VERIFY OK: depth=0, /C=US/ST=CA/L=SanFrancisco/O=Fort-Funston/OU=changeme/CN=vps008/name=changeme/emailAddress=
xyz@gmail.com
Fri Sep 06 15:20:24 2013 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Fri Sep 06 15:20:24 2013 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri Sep 06 15:20:24 2013 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Fri Sep 06 15:20:24 2013 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri Sep 06 15:20:24 2013 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA
Fri Sep 06 15:20:24 2013 [vps008] Peer Connection Initiated with ABC.DEF.213.117:1194
Fri Sep 06 15:20:26 2013 SENT CONTROL [vps008]: 'PUSH_REQUEST' (status=1)
Fri Sep 06 15:20:26 2013 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway,dhcp-option DNS 8.8.8.8,dhcp-option DNS 8.8.4.4,route-gateway GHI.JKL.22.1,ping 5,ping-restart 30,ifconfig GHI.JKL.22.109 255.255.255.128'
Fri Sep 06 15:20:26 2013 OPTIONS IMPORT: timers and/or timeouts modified
Fri Sep 06 15:20:26 2013 OPTIONS IMPORT: --ifconfig/up options modified
Fri Sep 06 15:20:26 2013 OPTIONS IMPORT: route options modified
Fri Sep 06 15:20:26 2013 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Fri Sep 06 15:20:26 2013 TAP-WIN32 device [Local Area Connection 2] opened: \\.\Global\{CB8C7835-7624-4CAA-850B-4404BD2D6C10}.tap
Fri Sep 06 15:20:26 2013 TAP-Win32 Driver Version 8.4
Fri Sep 06 15:20:26 2013 TAP-Win32 MTU=1500
Fri Sep 06 15:20:26 2013 Notified TAP-Win32 driver to set a DHCP IP/netmask of GHI.JKL.22.109/255.255.255.128 on interface {CB8C7835-7624-4CAA-850B-4404BD2D6C10} [DHCP-serv: GHI.JKL.22.0, lease-time: 31536000]
Fri Sep 06 15:20:26 2013 Successful ARP Flush on interface [16] {CB8C7835-7624-4CAA-850B-4404BD2D6C10}
Fri Sep 06 15:20:27 2013 TEST ROUTES: 1/1 succeeded len=0 ret=1 a=0 u/d=up
Fri Sep 06 15:20:27 2013 route ADD ABC.DEF.213.117 MASK 255.255.255.255 192.168.1.1
OK!
Fri Sep 06 15:20:27 2013 route DELETE 0.0.0.0 MASK 0.0.0.0 192.168.1.1
OK!
Fri Sep 06 15:20:27 2013 route ADD 0.0.0.0 MASK 0.0.0.0 GHI.JKL.22.1
OK!
Fri Sep 06 15:20:27 2013 Initialization Sequence Completed
*******************
Precisely again, I want to use the secondary IP given by the VM provider (server side) JHI.JKL.236.109/25 with default gateway of JHI.JKL.236.1; on the VPN client. All traffic after VPN connected should be routed using this as a source.
Kind help shall be highly appreciated !
Regards,
Nawab