wiki:313-how-can-i-connect-windows-xp-to-a-linux-based-samba-server-using-routing-rather-than-bridging

How can I connect Windows XP to a Linux-based Samba server using routing rather than bridging?

internal net: 192.168.1.0/24
samba server: 192.168.1.5
gateway 192.168.1.1
windows xp: dialup networking

server config on linux gateway:

dev tun0
ifconfig 192.168.5.6 192.168.5.5 <-- openvpn-net
port 12345
verb 1
local 123.123.123.12 <-- official server ip adress
user nobody
group nogroup
secret /etc/openvpn/key
tun-mtu 1500
daemon

open port 12345 on the firewall on server (gateway)

on windows xp:

Go to windows network panel.
Set the windows tap-device from application control to always connected.
Set the ipadress to 192.168.5.5 netmask 255.255.255.252.
Leave DNS and gateway empty.

openvpn config on Windows XP:

dev tun0
ifconfig 192.168.5.5 192.168.5.6 <-- openvpn-net
port 12345
ip-win32 manual
verb 1
remote 123.123.123.12 <-- official serveripadress
secret C:\programme\openvpn\config\key
tun-mtu 1500
ping 30

create a batchfile:

route add 192.168.1.0 mask 255.255.255.0 192.168.5.6
ping 192.168.1.5
net use g: \\192.168.1.5\Daten /USER:user1 <-- your account on samba!!

After connecting to the internet, start the batch file
and enter the password for samba.

Viola, now you have the service Daten on drive g:.

Now you can set the service openvpn to start automatically
and only start the batch file
after internet connection.

Richard Lechner

Return to FAQ

Last modified 10 years ago Last modified on 01/30/14 16:16:18