Category Archives: Linux networking

centos create PPTP VPN server

#!/bin/bash -x

#
# drewsymo/VPN
#
# Installs a PPTP VPN-only system for CentOS
#
# @package VPN 2.0
# @since VPN 1.0
# @author Drew Morris
# @url http://drewsymo.com/networking/vpn/install-ptpp/
#

# Create UDF Options

## VPN Username
#

## VPN Password
#

## VPN Local IP
#

## VPN Remote IP
#

(

VPN_IP=`curl ipv4.icanhazip.com>/dev/null 2>&1`

yum -y groupinstall “Development Tools”
rpm -Uvh http://poptop.sourceforge.net/yum/stable/rhel6/pptp-release-current.noarch.rpm
yum -y install policycoreutils policycoreutils
yum -y install ppp pptpd
yum -y update

echo “1” > /proc/sys/net/ipv4/ip_forward
sed -i ‘s/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/g’ /etc/sysctl.conf

sysctl -p /etc/sysctl.conf

echo “localip $VPN_LOCAL” >> /etc/pptpd.conf # Local IP address of your VPN server
echo “remoteip $VPN_REMOTE” >> /etc/pptpd.conf # Scope for your home network

echo “ms-dns 8.8.8.8” >> /etc/ppp/options.pptpd # Google DNS Primary
echo “ms-dns 209.244.0.3” >> /etc/ppp/options.pptpd # Level3 Primary
echo “ms-dns 208.67.222.222” >> /etc/ppp/options.pptpd # OpenDNS Primary

echo “$VPN_USER pptpd $VPN_PASS *” >> /etc/ppp/chap-secrets

service iptables start
echo “iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE” >> /etc/rc.local
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
service iptables save
service iptables restart

service pptpd restart

echo -e ‘\E[37;44m'”\033[1m Installation Log: /var/log/vpn-installer.log \033[0m”
echo -e ‘\E[37;44m'”\033[1m You can now connect to your VPN via your external IP ($VPN_IP)\033[0m”

echo -e ‘\E[37;44m'”\033[1m Username: $VPN_USER\033[0m”
echo -e ‘\E[37;44m'”\033[1m Password: $VPN_PASS\033[0m”

) 2>&1 | tee /var/log/vpn-installer.log

VPN PPTP Client

yum install pptp
vi /etc/ppp/chap-secrets
my_username vpn.linux4yyou.tk “my_password” *
[username][space][server name][space][password][space][ip address allowed]

vi /etc/ppp/peers/vpn.linux4yyou.tk
pty “pptp vpn.linux4yyou.tk –nolaunchpppd”
name my_username
remotename vpn.linux4yyou.tk
require-mppe-128
file /etc/ppp/options.pptp
ipparam vpn.linux4yyou.tk

modprobe ppp_mppe

vi /etc/ppp/options.pptp
lock
noauth
refuse-pap
refuse-eap
refuse-chap
nobsdcomp
nodeflate
require-mppe-128

pppd call vpn.linux4yyou.tk

ip a | grep ppp
tail -f /var/log/message | grep ppp

igb eth0 reset adapter

cd /tmp
curl “http://downloads.sourceforge.net/project/e1000/igb%20stable/5.1.2/igb-5.1.2.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fe1000%2Ffiles%2Figb%2520stable%2F5.1.2%2Figb-5.1.2.tar.gz%2Fdownload&ts=1392823683&use_mirror=superb-dca2” [^]
tar xzvf igb-5.1.2.tar.gz -C /usr/local/src
cd /usr/local/src/igb-5.1.2/src
yum install kernel-devel
make install
rmmod igb; modprobe igb

Cat6 cable

Cat6 cables, also called Category 6 or Cat 6 cables, provide lower crosstalk, a higher signal-to-noise ratio, and are suitable for 10GBASE-T (10-Gigabit Ethernet), while Cat5e cables support only up to 1000BASE-T (Gigabit Ethernet).
As a means of future-proofing your network, Cat6 is generally a better choice and worth the small premium in price. Cat5e and Cat6 cables are both backwards compatible, which means newer Cat6 cables can be used with older Cat5e, Cat5 and even Cat3 equipment.

NFS shared file system

mkdir /dba

Add the following lines to the /etc/exports file.

/dba *(rw,sync,no_wdelay,insecure_locks,no_root_squash)

Run the following command to export the NFS shares.
chkconfig nfs on
service nfs restart
Log into another server and mount the the NFS share:

Add the following lines to the /etc/fstab file:
nfs_server:/dba /home/oracle nfs rw,bg,hard,nointr,tcp,vers=3,timeo=300,rsize=32768,wsize=32768,actimeo=0 0 0

chown -R oracle:oinstall /home/oracle