SOLVED: VPN connection fails after installing Samba
Posted: Wed Oct 26, 2011 8:18 am
I had OpenVPN working. Tested the connection from inside the office LAN and from a remote PC. The office PC runs Ubuntu and the Network Manager indicated a connection was made. The remote PC runs Windows and the OpenVPN client GUI gave messages that the connection was made and the taskbar icon showed two green "PCs". I tested it a couple of times and in all cases it worked. So, I am pretty sure the OpenVPN server is running correctly.
I then installed Samba on to the file server. After that I cannot get the clients to connect through the VPN.
The Ubuntu PC in the LAN reports that the connection times-out, while the remote Windows PC returns "Connection reset by peer" error, indicating not connection cannot be made.
I have editted the Samba configuration file to allow the VPN IP range.
Another issue I have, which might be related, is that once OpenVPN has been installed, resvolvconf does not seem to work. After installing OpenVPN, regular connection to internet, from the file server, is lost - that is applications such as apt-get and wget cannot access the internet. I can fix this each time by stopping OpenVPN and manually editting resolv.conf by adding the gateway IP address. these changes are lost when the server is restarted.
smb.conf
server.conf
I then installed Samba on to the file server. After that I cannot get the clients to connect through the VPN.
The Ubuntu PC in the LAN reports that the connection times-out, while the remote Windows PC returns "Connection reset by peer" error, indicating not connection cannot be made.
I have editted the Samba configuration file to allow the VPN IP range.
Another issue I have, which might be related, is that once OpenVPN has been installed, resvolvconf does not seem to work. After installing OpenVPN, regular connection to internet, from the file server, is lost - that is applications such as apt-get and wget cannot access the internet. I can fix this each time by stopping OpenVPN and manually editting resolv.conf by adding the gateway IP address. these changes are lost when the server is restarted.
smb.conf
Code: Select all
[global]
log file = /var/log/samba/log.%m
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
obey pam restrictions = yes
map to guest = bad user
encrypt passwords = yes
public = yes
passwd program = /usr/bin/passwd %u
passdb backend = tdbsam
dns proxy = no
netbios name = heikkinen
writeable = yes
server string = samba server
unix password sync = yes
workgroup = heikkinen
os level = 20
security = share
syslog = 0
panic action = /usr/share/samba/panic-action %d
usershare allow guests = yes
max log size = 1000
pam password change = yes
hosts allow = 192.168.1.0/24 10.8.0.0/24 127.0.0.1 #added to allow OpenVPN server access
interfaces = 192.168.1.0/24 10.8.0.0/24
[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
[homes]
comment = Home directories
path = /home
Code: Select all
port 1194
proto udp
dev tun
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/server.crt
key /etc/openvpn/easy-rsa/keys/server.key # This file should be kept secret
dh /etc/openvpn/easy-rsa/keys/dh1024.pem
server 10.8.0.0 255.255.255.0
user nobody
group nobody
ifconfig-pool-persist ipp.txt
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
log-append /var/log/openvpn.log
verb 4
daemon