Awesome Open Source
Awesome Open Source

SMARTVPN

SmartVPNOPENVPNOpenVPN

  • VPN Server
  • VPN Client

lzo-2.03           :/usr/local           :null
openssl-1.0.2k     :/usr/local/openssl   :null
openvpn-2.1_rc22   :/usr/local/openvpn   :/etc/openvpn  :/var/log/openvpn-server/client.log
smartvpn-x.x.x     :/usr/local/smartvpn  :null

openvpn

/etc/init.d/openvpn start/stop

smartvpnSERVERCLIENT

/usr/local/smartvpn/smartvpn #

linux expect tools    #SSHCLIENT

Red Hat Enterprise Linux Server release 6.4 (Santiago)

smartvpn_x.x.x
 smartvpn.sh                    #

smartvpn-package               #
       init.d.openvpn            #init.dopenvpn
       lzo-2.03.tar.gz           #lzo
       openssl-1.0.2k.tar.gz     #openssl
       openvpn-2.1_rc22.tar.gz   #openvpn
       openvpn-config.tar.gz     #openvpn

VPN SERVER


(smartvpn_x.x.x)/usr/local/smartvpn , /usr/local/smartvpn

mkdir /usr/local/smartvpn
cp * /usr/local/smartvpn
cd /usr/local/smartvpn

lzo-2.03.tar.gz

cd smartvpn-package
tar -zxvf lzo-2.03.tar.gz
cd lzo-2.03
./configure -prefix=/usr/local && make && make install
cd ..
rm -rf lzo-2.03.tar.gz
cd ..

2 openssl-1.0.2k

cd smartvpn-package
tar -zxvf openssl-1.0.2k.tar.gz
cd openssl-1.0.2k
./config -prefix=/usr/local/openssl && make && make install
cd ..
rm -rf openssl-1.0.2k
cd ..

3 openvpn-2.1_rc22.tar.gz

cd smartvpn-package
tar -zxvf openvpn-2.1_rc22.tar.gz
cd openvpn-2.1_rc22
./configure -prefix=/usr/local/openvpn && make && make install
cd ..
rm -rf openvpn-2.1_rc22
cd ..

4

sed -i '/net.ipv4.ip_forward/ s/\(.*= \).*/\11/' /etc/sysctl.conf
sysctl -p

5

mkdir -r /etc/openvpn
cd smartvpn-package
tar -zxvf openvpn-config.tar.gz
cp -R ./openvpn-config /etc/openvpn
rm -rf openvpn-config
cd ..
cp -r ./smartvpn-package/init.d.openvpn /etc/init.d/openvpn
sed -i "s/client/server/g" /etc/init.d/openvpn
chmod +x /etc/init.d/openvpn

6

shell

  • $SERVERIP IP
  • $SERVERIPAREA OPENVPN172.31.0.0 255.255.255.0
  • $PORT OPENVPN10050
cd /etc/openvpn/easy-rsa/
source ./vars
./clean-all
./build-ca #
./build-key-server server #y
./build-dh
cp ./keys/server.* /etc/openvpn/keys
cp ./keys/*.pem /etc/openvpn/keys
cp ./keys/ca* /etc/openvpn/keys
sed -i "s/#LOCALIP#/$SERVERIP/g" /etc/openvpn/server.conf
sed -i "s/#PORT#/$PORT/g" /etc/openvpn/server.conf
sed -i "s/#SERVERIPAREA#/$SERVERIPAREA/g" /etc/openvpn/server.conf
sed -i "s/#SERVERIP#/$SERVERIP/g" /etc/openvpn/client-conf/client.conf
sed -i "s/#PORT#/$PORT/g" /etc/openvpn/client-conf/client.conf

7OPENVPN

/etc/init.d/openvpn start

/etc/openvpn
 ccd                CCD
    CLIENT_110     CLIENT_110CLIENT
 client-conf        CLIENT
    CLIENT_110     CLIENT_110CLIENT
    client.conf    CLIENT
 easy-rsa           rsa2.0
 ipp.txt
 keys               SERVERKEY
    01.pem
    ca.crt
    ca.key
    dh1024.pem
    server.crt
    server.csr
    server.key
 server.conf        SERVER

CLIENT

CLIENTSERVERCLIENT_$CLIENTID

cd /etc/openvpn/easy-rsa/
source ./vars
./build-key CLIENT_$CLIENTID  #y
mkdir -p /etc/openvpn/client-conf/CLIENT_$CLIENTID/keys
cp ./keys/CLIENT_$CLIENTID* /etc/openvpn/client-conf/CLIENT_$CLIENTID/keys
cp ./keys/ca.crt /etc/openvpn/client-conf/CLIENT_$CLIENTID/keys
cp /etc/openvpn/client-conf/client.conf /etc/openvpn/client-conf/CLIENT_$CLIENTID/
mv /etc/openvpn/client-conf/CLIENT_$CLIENTID/keys/CLIENT_$CLIENTID.crt /etc/openvpn/client-conf/CLIENT_$CLIENTID/keys/client.crt
mv /etc/openvpn/client-conf/CLIENT_$CLIENTID/keys/CLIENT_$CLIENTID.csr /etc/openvpn/client-conf/CLIENT_$CLIENTID/keys/client.csr
mv /etc/openvpn/client-conf/CLIENT_$CLIENTID/keys/CLIENT_$CLIENTID.key /etc/openvpn/client-conf/CLIENT_$CLIENTID/keys/client.key

/etc/openvpn/client_conf/CLIENT_$CLIENTID CLIENT

VPN CLIENT


(smartvpn_x.x.x)/usr/local/smartvpn , /usr/local/smartvpn

mkdir /usr/local/smartvpn
cp * /usr/local/smartvpn
cd /usr/local/smartvpn

lzo-2.03.tar.gz

cd smartvpn-package
tar -zxvf lzo-2.03.tar.gz
cd lzo-2.03
./configure -prefix=/usr/local && make && make install
cd ..
rm -rf lzo-2.03.tar.gz
cd ..

2 openssl-1.0.2k

cd smartvpn-package
tar -zxvf openssl-1.0.2k.tar.gz
cd openssl-1.0.2k
./config -prefix=/usr/local/openssl && make && make install
cd ..
rm -rf openssl-1.0.2k
cd ..

3 openvpn-2.1_rc22.tar.gz

cd smartvpn-package
tar -zxvf openvpn-2.1_rc22.tar.gz
cd openvpn-2.1_rc22
./configure -prefix=/usr/local/openvpn && make && make install
cd ..
rm -rf openvpn-2.1_rc22
cd ..

4

sed -i '/net.ipv4.ip_forward/ s/\(.*= \).*/\11/' /etc/sysctl.conf
sysctl -p

5

mkdir -r /etc/openvpn

# /etc/openvpn/client_conf/CLIENT_$CLIENTID/*

cd /usr/local/smartvpn
cp -r ./smartvpn-package/init.d.openvpn /etc/init.d/openvpn
chmod +x /etc/init.d/openvpn

6OPENVPN

/etc/init.d/openvpn start

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Shell (182,340
Openssl (4,334
Vpn (3,998
Openvpn (1,832
Vpn Server (337
Vpn Client (230
Lzo (12