Hi,
I have a remote server running openvpn.
- connected to internet with eth0, public IP address, currently no DNS name pointing to this address.
- vpn server IP address space: 10.8.0.x
- vpn server ip: 10.8.0.1
- server hostname ServerOne.
- Centos 6.5
- clients on Mac, linux and windows
Current status:
* I can connect to the VPN server using the public IP address, no firewall issues.
* After connection I can contact several services (webserver, SQL server, ...) on the remote server on IP address 10.8.0.1
* client traffic not destined for 10.8.0.1 is NOT routed through the VPN server, hence the commented
#push "redirect-gateway def1 bypass-dhcp"
* currently no DNS servers are pushed to the client, though routing DNS queries via the vpn server would be acceptable. I do not want to route regular client internet traffic through the server.
What do I want to do?
Currenlty, from the clients, I can only access the server by ip address. I would like to access it either by hostname or by some dns entry.
I have been looking into pushing WINS or other dhcp options but no luck so far. Nmb (samba) seems to have trouble binding port 137 to address 10.8.0.255 (not sure that's the address it should be binding to...)
I have a feeling I can use DNSMasq (or another DNS solution) and push the server IP as dns server to setup some hostname or subdomain and forward all other dns requests to other dns servers on the internet but I haven't found any examples or pointers for this specific situation.
=> Does anyone have any hints or advice on how to set this up?
=> what should I be using for this? Samba/WINS? Dnsmasq? Something else?
=> we have a dns name pointing to a public website, would adding an entry for a subdomain pointing to 10.8.0.1 be a solution?
Any help appreciated 😉
server.conf
port 1194
proto udp
dev tun
ca ca.crt
cert s1.something.com.crt
key s1.something.com.key # This file should be kept secret
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
#push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option WINS 10.8.0.1"
keepalive 10 120
comp-lzo
user nobody
group nobody
persist-key
persist-tun
status openvpn-status.log
verb 3
crl-verify /etc/openvpn/crl.pem
client.ovpn
client
dev tun
proto udp
remote a.b.c.d 1194
resolv-retry infinite
nobind
persist-key
persist-tun
comp-lzo
verb 3
ca ca.crt
cert clientcert.crt
key clientcert.key
smb.conf
[global]
workgroup = corporateNetwork
server string = Samba Server Version %v
netbios name = ServerOne
interfaces = lo 10.8.0.1/24
hosts allow = 127. 10.8.0.
bind interfaces only = yes
log file = /var/log/samba/log.%m
max log size = 50
security = user
passdb backend = tdbsam
domain master = yes
local master = yes
os level = 33
preferred master = yes
wins support = yes