Hi!
I installed an OpenVPN server on a computer which contains a web server and a samba server. What I want is that any client connecting to the VPN can access to web pages of this server and be able to navigate in the samba server.
The best case is that the client can access to the network where the server is connected.
I don't know if you understand what I want to do...
Here are my server.conf, client.conf and iptables :
Server:
local 192.168.1.20
port 1194
proto tcp-server
dev tun
ca /etc/openvpn/ca.crt
cert /etc/openvpn/vpnserver.crt
key /etc/openvpn/vpnserver.key
dh /etc/openvpn/dh1024.pem
server 10.4.0.0 255.255.255.0
keepalive 10 120
client-to-client
push "route 192.168.1.0 255.255.255.0"
cipher AES-128-CBC
comp-lzo
max-clients 5
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
log openvpn.log
verb 6
push "redirect-gateway def1"
duplicate-cn
iptables:
iptables -A INPUT -i eth0 -m state --state NEW -p tcp --dport 1194 -j ACCEPT
iptables -A INPUT -i tun0 -j ACCEPT
iptables -A FORWARD -i tun0 -j ACCEPT
iptables -A FORWARD -i tun0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth0 -o tun0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.4.0.0/24 -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i tun0 -o eth0 -j ACCEPT
Client:
client
dev tun
proto tcp
remote [external.server.ip] 1194
resolv-retry infinite
nobind
persist-key
persist-tun
mute-replay-warnings
ca ca.crt
cert vpnclient.crt
key vpnclient.key
cipher AES-128-CBC
comp-lzo
verb 5
I'm sure I have some errors or useless code, so I hope you'll be able to help me :cry:
Thanks!