here's simpler ways to use server as vpn server, you just need install webmin then everything will be run as you want. Let's start :
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o tun0 -m state –state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i tun0 -o eth0 -j ACCEPT
install openvpn and webmin
add webmin repository on your source list (/etc/apt/sources.list)
deb http://download.webmin.com/download/repository sarge contribadd key and update repository
sudo wget http://www.webmin.com/jcameron-key.asc
sudo apt-key add jcameron-key.asc
sudo apt-get update
install openvpn and webmin
sudo apt-get install openvpn webmin
install openvpn gui admin web
download openvpn admin module : here
log into : https://your_vpnserver_ip:10000
go to "module index" => install module
go to "OpenVpn + CA" => "Certification Authority list" then create new CA
go to "OpenVpn + CA" => "Certification Authority list" then click on "key list" to create server key, don't forget to choose "key server" type is "SERVER"
go to "OpenVpn + CA" => "Certification Authority list" then click on "key list" to create client key, don't forget to choose "key server" type is "CLIENT"
go to "OpenVpn + CA" => "vpn list" then create new vpn
save and start your vpn
Openvpn Client setup
go to "vpn server list" => Client list
create new client, then export the configuration file
then you are ready to connect with openvpn gui client.
if you want to remove the client, you may remove it from that menu.
setup your routing table
edit your /etc/sysctl.conf and make sure that ip_forward is 1 (un comment it)
net.ipv4.ip_forward=1
change your vpn server routing table
sudo echo 1 > /proc/sys/net/ipv4/ip_forwardsudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o tun0 -m state –state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i tun0 -o eth0 -j ACCEPT
..show all:.
.
here's simpler ways to use server as vpn server, you just need install webmin then everything will be run as you want. Let's start :
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o tun0 -m state –state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i tun0 -o eth0 -j ACCEPT
install openvpn and webmin
add webmin repository on your source list (/etc/apt/sources.list)
deb http://download.webmin.com/download/repository sarge contribadd key and update repository
sudo wget http://www.webmin.com/jcameron-key.asc
sudo apt-key add jcameron-key.asc
sudo apt-get update
install openvpn and webmin
sudo apt-get install openvpn webmin
install openvpn gui admin web
download openvpn admin module : here
log into : https://your_vpnserver_ip:10000
go to "module index" => install module
go to "OpenVpn + CA" => "Certification Authority list" then create new CA
go to "OpenVpn + CA" => "Certification Authority list" then click on "key list" to create server key, don't forget to choose "key server" type is "SERVER"
go to "OpenVpn + CA" => "Certification Authority list" then click on "key list" to create client key, don't forget to choose "key server" type is "CLIENT"
go to "OpenVpn + CA" => "vpn list" then create new vpn
save and start your vpn
Openvpn Client setup
go to "vpn server list" => Client list
create new client, then export the configuration file
then you are ready to connect with openvpn gui client.
if you want to remove the client, you may remove it from that menu.
setup your routing table
edit your /etc/sysctl.conf and make sure that ip_forward is 1 (un comment it)
net.ipv4.ip_forward=1
change your vpn server routing table
sudo echo 1 > /proc/sys/net/ipv4/ip_forwardsudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o tun0 -m state –state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i tun0 -o eth0 -j ACCEPT
your iptables forrward command doesn't work
ReplyDeletesudo iptables -A FORWARD -i eth0 -o tun0 -m state–state RELATED,ESTABLISHED -j ACCEPT
iptables v1.6.0: Couldn't load match `state–state':No such file or directory
and with a space it says -state bad option