Feb 22, 2014

install openvpn webmin ubuntu

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 :

install openvpn and webmin

add webmin repository on your source list (/etc/apt/sources.list)

deb http://download.webmin.com/download/repository sarge contrib

add 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 
install openvpn webmin ubuntu
go to "OpenVpn + CA" =>  "Certification Authority list" then create new CA
openvpn create 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"
openvpn create server key

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"
openvpn create client key

go to "OpenVpn + CA" =>  "vpn list" then create new vpn
webmin create new vpn list
webmin create new vpn list

save and start your vpn

Openvpn Client setup 

go to "vpn server list" => Client list 
webmin create new client list

create new client, then export the configuration file 
webmin client list
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_forward
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 

.
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 :

install openvpn and webmin

add webmin repository on your source list (/etc/apt/sources.list)

deb http://download.webmin.com/download/repository sarge contrib

add 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 
install openvpn webmin ubuntu
go to "OpenVpn + CA" =>  "Certification Authority list" then create new CA
openvpn create 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"
openvpn create server key

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"
openvpn create client key

go to "OpenVpn + CA" =>  "vpn list" then create new vpn
webmin create new vpn list
webmin create new vpn list

save and start your vpn

Openvpn Client setup 

go to "vpn server list" => Client list 
webmin create new client list

create new client, then export the configuration file 
webmin client list
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_forward
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 

1 comment:

  1. your iptables forrward command doesn't work

    sudo 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

    ReplyDelete