Hey,
This one is a little complicated and I've been cracking my head over it for a while. Right about now I'm crying out for help.
This is the deal, I got cisco vpn to connect to the office but unfortunately I got XP x64 and cisco cant seem to provide a proper client for x64 OS' so far. I don't want to reinstall my computer therefore I found a creative solution.
I decided to install VMware server(which is free now! woohoo) and setup up a light weight ubu-server to run 'VPNC' client to connect to the VPN. So far, so good.
It kinda works, I can access the VPN from the VMware guest hosted ubu, I can ping the local VPN addresses.
The main idea of this solution is to keep the VMware host with the guest ubu minimized, connected to the VPN permanently and route all the traffic from the VPN directly to the host machine.
The VMware GUEST (ubu-server) set with 2 NiCs:- VMnet0 - Bridged connection
- IP: 10.0.0.13 / 255.0.0.0
- Gateway: 10.0.0.138
- VMnet1 - Host only
- IP: 192.168.0.2 / 255.255.255.0
- Gateway: -
- VPN TUNNEL-00
- IP: 172.21.32.39 / 255.255.255.255 (auto assigned by the CISCO PIX)
- Gateway: -
The VMware HOST (Winxp x64) network settings: - Local Area Connection #1
- IP: 10.0.0.1 / 255.0.0.0
- Gateway: 10.0.0.138
- VMnet1 - Host only
- IP: 192.168.0.1 / 255.255.255.0
- Gateway: -
The IP I'm trying to access over the VPN is:
172.31.110.244.
From the GUEST machine it works at this point.
On the XP I did a route command to flow all the related traffic through the guest's ip.
- route add 172.31.0.0 MASK 255.255.0.0 10.0.0.13 METRIC 1
- route add 172.31.0.0 MASK 255.255.0.0 192.168.0.2 METRIC 1
Tried these two one by one but it didn't come up well.
ping timed out and tracert failed to complete a single hop.
I decided to try bridging the interfaces on the guest, between the gateway associated and the host only.
The script I used to bridge with:
Code:
brctl addbr br0;
brctl stp br0 on;
brctl addif br0 eth0;
brctl addif br0 eth1;
(ifdown eth0 1>/dev/null 2>&1;);
(ifdown eth1 1>/dev/null 2>&1;);
ifconfig eth0 0.0.0.0 up;
ifconfig eth1 0.0.0.0 up;
ifconfig br0 10.0.0.50 broadcast 10.255.255.255 netmask 255.0.0.0 up
route add default gw 10.0.0.138;
for file in br0 eth0 eth1;
do
echo "1" > /proc/sys/net/ipv4/conf/${file}/proxy_arp;
echo "1" > /proc/sys/net/ipv4/conf/${file}/forwarding;
done;
echo "1" > /proc/sys/net/ipv4/ip_forward;
The br0 interface ip I got:
10.0.0.50.
ifconfig:
Code:
ubu-vpnc:/var/log# ifconfig
br0 Link encap:Ethernet HWaddr 00:0C:29:7F:5A:E7
inet addr:10.0.0.50 Bcast:10.255.255.255 Mask:255.0.0.0
inet6 addr: fe80::20c:29ff:fe7f:5ae7/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2796 errors:0 dropped:0 overruns:0 frame:0
TX packets:3455 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:499156 (487.4 KiB) TX bytes:462418 (451.5 KiB)
eth0 Link encap:Ethernet HWaddr 00:0C:29:7F:5A:E7
inet6 addr: fe80::20c:29ff:fe7f:5ae7/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:38210 errors:0 dropped:0 overruns:0 frame:0
TX packets:8747 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:20330050 (19.3 MiB) TX bytes:789264 (770.7 KiB)
Base address:0x1070 Memory:ec820000-ec840000
eth1 Link encap:Ethernet HWaddr 00:0C:29:7F:5A:F1
inet6 addr: fe80::20c:29ff:fe7f:5af1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:62 errors:0 dropped:0 overruns:0 frame:0
TX packets:5102 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8546 (8.3 KiB) TX bytes:297839 (290.8 KiB)
Base address:0x1078 Memory:ec840000-ec860000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:20 errors:0 dropped:0 overruns:0 frame:0
TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1688 (1.6 KiB) TX bytes:1688 (1.6 KiB)
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:172.21.32.39 P-t-P:172.21.32.39 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1390 Metric:1
RX packets:279 errors:0 dropped:0 overruns:0 frame:0
TX packets:505 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:285272 (278.5 KiB) TX bytes:38941 (38.0 KiB)
ubu-vpnc:/var/log#
I've also added some iptables rules to monitor the logs and accept forwarding:
Code:
iptables -P FORWARD ACCEPT
iptables -F FORWARD
iptables -I FORWARD -j ACCEPT
iptables -I FORWARD -j LOG
I've also updated the route command at the XP to this following:
- route add 172.31.0.0 MASK 255.255.0.0 10.0.0.50 METRIC 1
at this point it looked much better, I tried to ping the destination ip on the host ip and could see the trace log of the iptables which means the traffic from the host goes trough the guest.
also the tracert made a single hop:
Code:
C:\>tracert 172.31.110.244
Tracing route to 172.31.110.244 over a maximum of 30 hops
1 <1 ms <1 ms <1 ms 10.0.0.50
2 * * * Request timed out.
.....
30 * * * Request timed out.
syslog at the same point of the trace on the guest machine:
Code:
Sep 26 23:57:11 ubu-vpnc kernel: IN=br0 OUT=tun0 PHYSIN=eth0 SRC=10.0.0.1 DST=172.31.110.244 LEN=78 TOS=0x00 PREC=0x00 TTL=127 ID=16734 PROTO=UDP SPT=137 DPT=137 LEN=58
Sep 26 23:57:12 ubu-vpnc kernel: IN=br0 OUT=tun0 PHYSIN=eth0 SRC=10.0.0.1 DST=172.31.110.244 LEN=78 TOS=0x00 PREC=0x00 TTL=127 ID=16735 PROTO=UDP SPT=137 DPT=137 LEN=58
Sep 26 23:57:14 ubu-vpnc kernel: IN=br0 OUT=tun0 PHYSIN=eth0 SRC=10.0.0.1 DST=172.31.110.244 LEN=78 TOS=0x00 PREC=0x00 TTL=127 ID=16736 PROTO=UDP SPT=137 DPT=137 LEN=58
Sep 26 23:57:23 ubu-vpnc kernel: IN=br0 OUT=tun0 PHYSIN=eth0 SRC=10.0.0.1 DST=172.31.110.244 LEN=78 TOS=0x00 PREC=0x00 TTL=127 ID=16746 PROTO=UDP SPT=137 DPT=137 LEN=58
Sep 26 23:57:24 ubu-vpnc kernel: IN=br0 OUT=tun0 PHYSIN=eth0 SRC=10.0.0.1 DST=172.31.110.244 LEN=78 TOS=0x00 PREC=0x00 TTL=127 ID=16747 PROTO=UDP SPT=137 DPT=137 LEN=58
Sep 26 23:57:26 ubu-vpnc kernel: IN=br0 OUT=tun0 PHYSIN=eth0 SRC=10.0.0.1 DST=172.31.110.244 LEN=78 TOS=0x00 PREC=0x00 TTL=127 ID=16748 PROTO=UDP SPT=137 DPT=137 LEN=58
Sigh! At this point, I don't have any more ideas how to fix the routes to make it work properly.
Any ideas are welcome (not ideas to drop the solution but how to make the route thing work, I also would like to learn from this something
)
Regards,
Oleg G.