Initial commit.
This commit is contained in:
3
ppp/chap-secrets
Normal file
3
ppp/chap-secrets
Normal file
@@ -0,0 +1,3 @@
|
||||
# Secrets for authentication using CHAP
|
||||
# client server secret IP addresses
|
||||
bogdan.stoica * "d8z4a80GZD" *
|
||||
46
ppp/check-vpn
Executable file
46
ppp/check-vpn
Executable file
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
|
||||
# check if cron is still running; if it is, then just exit; otherwise execute cron job
|
||||
#[[ -f /tmp/*.vpncron ]] && exit 1
|
||||
|
||||
# create a temp file with suffix
|
||||
TEMP_FILE=`mktemp --suffix .vpncron`
|
||||
touch $TEMP_FILE
|
||||
|
||||
EXTIF="ppp0" # external interface, may be empty
|
||||
IFCONFIG=/sbin/ifconfig
|
||||
AWK=/bin/awk
|
||||
|
||||
HOSTS="sg3.gazduire.ro vg11.gazduire.ro rg5.gazduire.ro dbv5.gazduire.ro"
|
||||
# no ping request
|
||||
COUNT=1
|
||||
|
||||
for server in $HOSTS
|
||||
do
|
||||
count=$(ping -c $COUNT $server | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }')
|
||||
if [ $count -eq 0 ]; then
|
||||
# 100% failed
|
||||
echo "Host : $server is down (ping failed) at $(date)"
|
||||
/etc/init.d/vpn-gzd stop
|
||||
sleep 1
|
||||
/etc/init.d/vpn-gzd start
|
||||
fi
|
||||
done
|
||||
|
||||
# get the external IP address - it returns empty string if it is not up
|
||||
if [ -n "$EXTIF" ]; then
|
||||
EXTIP=`$IFCONFIG | grep inet | grep -v 127.0.0.1 | grep -v 10.208 | grep -v inet6 | $AWK '{print $2}'`
|
||||
fi
|
||||
#echo " External IP: $EXTIP"
|
||||
|
||||
if [ -z "$EXTIP" ]; then
|
||||
echo "Starting VPN tunnel.."
|
||||
/etc/init.d/vpn-gzd stop
|
||||
sleep 1
|
||||
/etc/init.d/vpn-gzd start
|
||||
else
|
||||
echo "VPN tunnel is connected"
|
||||
fi
|
||||
|
||||
# delete cron temporary file
|
||||
rm -f $TEMP_FILE
|
||||
10
ppp/eaptls-client
Normal file
10
ppp/eaptls-client
Normal file
@@ -0,0 +1,10 @@
|
||||
# Parameters for authentication using EAP-TLS (client)
|
||||
|
||||
# client name (can be *)
|
||||
# server name (can be *)
|
||||
# client certificate file (required)
|
||||
# server certificate file (optional, if unused put '-')
|
||||
# CA certificate file (required)
|
||||
# client private key file (required)
|
||||
|
||||
#client server /root/cert/client.crt - /root/cert/ca.crt /root/cert/client.key
|
||||
11
ppp/eaptls-server
Normal file
11
ppp/eaptls-server
Normal file
@@ -0,0 +1,11 @@
|
||||
# Parameters for authentication using EAP-TLS (server)
|
||||
|
||||
# client name (can be *)
|
||||
# server name (can be *)
|
||||
# client certificate file (optional, if unused put '-')
|
||||
# server certificate file (required)
|
||||
# CA certificate file (required)
|
||||
# server private key file (required)
|
||||
# allowed addresses (required, can be *)
|
||||
|
||||
#client server - /root/cert/server.crt /root/cert/ca.crt /root/cert/server.key 192.168.1.0/24
|
||||
18
ppp/ip-down
Executable file
18
ppp/ip-down
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
# This file should not be modified -- make local changes to
|
||||
# /etc/ppp/ip-down.local instead
|
||||
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||
export PATH
|
||||
|
||||
LOGDEVICE=$6
|
||||
REALDEVICE=$1
|
||||
|
||||
/etc/ppp/ip-down.ipv6to4 ${LOGDEVICE}
|
||||
|
||||
[ -x /etc/ppp/ip-down.local ] && /etc/ppp/ip-down.local "$@"
|
||||
|
||||
/etc/sysconfig/network-scripts/ifdown-post --realdevice ${REALDEVICE} \
|
||||
ifcfg-${LOGDEVICE}
|
||||
|
||||
exit 0
|
||||
114
ppp/ip-down.ipv6to4
Executable file
114
ppp/ip-down.ipv6to4
Executable file
@@ -0,0 +1,114 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# ip-down.ipv6to4
|
||||
#
|
||||
#
|
||||
# Taken from:
|
||||
# (P) & (C) 2000-2005 by Peter Bieringer <pb@bieringer.de>
|
||||
#
|
||||
# You will find more information on the initscripts-ipv6 homepage at
|
||||
# http://www.deepspace6.net/projects/initscripts-ipv6.html
|
||||
#
|
||||
# Version 2005-09-22
|
||||
#
|
||||
# Calling parameters:
|
||||
# $1: interface name
|
||||
#
|
||||
# Called (mostly) by /etc/ppp/ip-down.local
|
||||
# like: /etc/ppp/ip-down.ipv6to4 $1 >>/var/log/ppp-ipv6to4.log 2>&1
|
||||
#
|
||||
# Note: this script will *check* whether the existing 6to4 tunnel
|
||||
# was set before by using "ip-up.ipv6to4" comparing IPv4 address
|
||||
# of device with the generated 6to4 prefix
|
||||
#
|
||||
# Uses following information from /etc/sysconfig/network-scripts/ifcfg-$1:
|
||||
# IPV6TO4INIT=yes|no: controls configuration
|
||||
# IPV6TO4_ROUTING="<device>-<suffix>/<prefix length> ...": information to setup additional interfaces
|
||||
#
|
||||
# IPV6_CONTROL_RADVD=yes|no: controls radvd triggering
|
||||
# IPV6_RADVD_PIDFILE=<file>: PID file of radvd for sending signals, default is "/var/run/radvd/radvd.pid"
|
||||
# IPV6_RADVD_TRIGGER_ACTION=startstop|reload|restart|SIGHUP: how to trigger radvd (optional, default is SIGHUP)
|
||||
#
|
||||
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo $"Argument 1 is empty but should contain interface name - skip IPv6to4 initialization"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get global network configuration
|
||||
. /etc/sysconfig/network
|
||||
|
||||
# Source IPv4 helper functions
|
||||
cd /etc/sysconfig/network-scripts
|
||||
. ./network-functions
|
||||
|
||||
CONFIG=$1
|
||||
[ -f "$CONFIG" ] || CONFIG=ifcfg-$CONFIG
|
||||
source_config
|
||||
|
||||
# IPv6 don't need aliases anymore, config is skipped
|
||||
REALDEVICE=${DEVICE%%:*}
|
||||
[ "$DEVICE" != "$REALDEVICE" ] && exit 0
|
||||
|
||||
if [ ! -f /etc/sysconfig/network-scripts/network-functions-ipv6 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
. /etc/sysconfig/network-scripts/network-functions-ipv6
|
||||
|
||||
|
||||
# Run basic IPv6 test, if not ok, skip IPv6 initialization
|
||||
ipv6_test testonly || exit 0
|
||||
|
||||
# Test status of ppp device
|
||||
ipv6_test_device_status $DEVICE
|
||||
if [ $? != 0 -a $? != 11 ]; then
|
||||
# device doesn't exist or other problem occurs
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test status of tun6to4 device
|
||||
ipv6_test_device_status tun6to4
|
||||
if [ $? = 0 -o $? = 11 ]; then
|
||||
# Device exists
|
||||
valid6to4config="yes"
|
||||
|
||||
# Get IPv4 address from interface
|
||||
ipv4addr="$(ipv6_get_ipv4addr_of_device $DEVICE)"
|
||||
if [ -z "$ipv4addr" ]; then
|
||||
# Has no IPv4 address
|
||||
valid6to4config="no"
|
||||
fi
|
||||
|
||||
# Get local IPv4 address of dedicated tunnel
|
||||
ipv4addr6to4local="$(ipv6_get_ipv4addr_of_tunnel tun6to4 local)"
|
||||
|
||||
# IPv6to4 not enabled on this interface?
|
||||
if [ $IPV6TO4INIT != "yes" ]; then
|
||||
# Check against configured 6to4 tunnel to see if this interface was regardless used before
|
||||
if [ "$ipv4addr" != "$ipv4addr6to4local" ]; then
|
||||
# IPv4 address of interface does't match local tunnel address, interface was not used for current 6to4 setup
|
||||
valid6to4config="no"
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if [ "$valid6to4config" = "yes" ]; then
|
||||
if [ "$IPV6_CONTROL_RADVD" = "yes" ]; then
|
||||
# Control running radvd
|
||||
ipv6_trigger_radvd down "$IPV6_RADVD_TRIGGER_ACTION" $IPV6_RADVD_PIDFILE
|
||||
fi
|
||||
|
||||
if [ -n "$IPV6TO4_ROUTING" ]; then
|
||||
# Delete routes to local networks
|
||||
for devsuf in $IPV6TO4_ROUTING; do
|
||||
dev="${devsuf%%-*}"
|
||||
ipv6_cleanup_6to4_device $dev
|
||||
done
|
||||
fi
|
||||
|
||||
# Delete all configured 6to4 address
|
||||
ipv6_cleanup_6to4_tunnels tun6to4
|
||||
fi
|
||||
17
ppp/ip-up
Executable file
17
ppp/ip-up
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
# This file should not be modified -- make local changes to
|
||||
# /etc/ppp/ip-up.local instead
|
||||
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||
export PATH
|
||||
|
||||
LOGDEVICE=$6
|
||||
REALDEVICE=$1
|
||||
|
||||
[ -f /etc/sysconfig/network-scripts/ifcfg-${LOGDEVICE} ] && /etc/sysconfig/network-scripts/ifup-post --realdevice ${REALDEVICE} ifcfg-${LOGDEVICE}
|
||||
|
||||
/etc/ppp/ip-up.ipv6to4 ${LOGDEVICE}
|
||||
|
||||
[ -x /etc/ppp/ip-up.local ] && /etc/ppp/ip-up.local "$@"
|
||||
|
||||
exit 0
|
||||
18
ppp/ip-up.d/route-traffic
Executable file
18
ppp/ip-up.d/route-traffic
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ppp interface
|
||||
IFACE="ppp0"
|
||||
|
||||
# gazduire.ro
|
||||
SG="188.214.17.0/24"
|
||||
VG="188.214.21.0/24"
|
||||
RG0="188.215.64.0/25"
|
||||
RG1="188.215.64.128/25"
|
||||
VPS="91.208.142.0/24"
|
||||
|
||||
# lastpass
|
||||
route add -net ${SG} dev ${IFACE}
|
||||
route add -net ${VG} dev ${IFACE}
|
||||
route add -net ${RG0} dev ${IFACE}
|
||||
route add -net ${RG1} dev ${IFACE}
|
||||
route add -net ${VPS} dev ${IFACE}
|
||||
193
ppp/ip-up.ipv6to4
Executable file
193
ppp/ip-up.ipv6to4
Executable file
@@ -0,0 +1,193 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# ip-up.ipv6to4
|
||||
#
|
||||
#
|
||||
# Taken from:
|
||||
# (P) & (C) 2000-2005 by Peter Bieringer <pb@bieringer.de>
|
||||
#
|
||||
# You will find more information on the initscripts-ipv6 homepage at
|
||||
# http://www.deepspace6.net/projects/initscripts-ipv6.html
|
||||
#
|
||||
# Version: 2005-09-22
|
||||
#
|
||||
# Calling parameters:
|
||||
# $1: interface name
|
||||
#
|
||||
# Called (mostly) by /etc/ppp/ip-up.local
|
||||
# like: /etc/ppp/ip-up.ipv6to4 $1 >>/var/log/ppp-ipv6to4.log 2>&1
|
||||
#
|
||||
# Note: this script will *kill* older still existing 6to4 tunnels regardless
|
||||
# whether they were set before by another device
|
||||
#
|
||||
# Uses following information from /etc/sysconfig/network-scripts/ifcfg-$1:
|
||||
# IPV6TO4INIT=yes|no: controls configuration
|
||||
# IPV6TO4_IPV4ADDR=<IPv4 address>: special local address for 6to4 tunneling (only needed behind a NAT gateway)
|
||||
# IPV6TO4_RELAY=<IPv4 address>: remote 6to4 relay router address (default: 192.88.99.1)
|
||||
# IPV6TO4_MTU=<MTU for IPv6>: controls IPv6 MTU for the 6to4 link (optional, default is MTU of interface - 20)
|
||||
# IPV6TO4_ROUTING="<device>-<suffix>/<prefix length> ...": information to setup additional interfaces
|
||||
# Example: IPV6TO4_ROUTING="eth0-:f101::1/64 eth1-:f102::1/64"
|
||||
#
|
||||
# IPV6_CONTROL_RADVD=yes|no: controls radvd triggering
|
||||
# IPV6_RADVD_PIDFILE=<file>: PID file of radvd for sending signals, default is "/var/run/radvd/radvd.pid"
|
||||
# IPV6_RADVD_TRIGGER_ACTION=startstop|reload|restart|SIGHUP: how to trigger radvd (optional, default is SIGHUP)
|
||||
#
|
||||
# Requirements
|
||||
# radvd-0.6.2p3 or newer supporting option "Base6to4Interface"
|
||||
#
|
||||
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo $"Argument 1 is empty but should contain interface name - skip IPv6to4 initialization"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get global network configuration
|
||||
. /etc/sysconfig/network
|
||||
|
||||
# Source IPv4 helper functions
|
||||
cd /etc/sysconfig/network-scripts
|
||||
. ./network-functions
|
||||
|
||||
CONFIG=$1
|
||||
[ -f "$CONFIG" ] || CONFIG=ifcfg-$CONFIG
|
||||
source_config
|
||||
|
||||
# IPv6 don't need aliases anymore, config is skipped
|
||||
REALDEVICE=${DEVICE%%:*}
|
||||
[ "$DEVICE" != "$REALDEVICE" ] && exit 0
|
||||
|
||||
if [ ! -f /etc/sysconfig/network-scripts/network-functions-ipv6 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
. /etc/sysconfig/network-scripts/network-functions-ipv6
|
||||
|
||||
|
||||
# Run basic IPv6 test (and make sure the ipv6 module will be loaded), if not ok, skip IPv6 initialization
|
||||
ipv6_test || exit 1
|
||||
|
||||
# Setup of 6to4, if configured
|
||||
valid6to4config="yes"
|
||||
if [ "$IPV6TO4INIT" = "yes" ]; then
|
||||
if [ -n "$IPV6TO4_IPV4ADDR" ]; then
|
||||
# Take 6to4-dedicated configured IPv4 address from config file (precedence 1)
|
||||
ipv4addr="$IPV6TO4_IPV4ADDR"
|
||||
else
|
||||
# Get IPv4 address from interface (precedence 2)
|
||||
ipv4addr="$(ipv6_get_ipv4addr_of_device $DEVICE)"
|
||||
if [ -z "$ipv4addr" ]; then
|
||||
# Take configured IPv4 address of interface from config file (precedence 3)
|
||||
ipv4addr="$IPADDR"
|
||||
fi
|
||||
fi
|
||||
if [ -n "$ipv4addr" ]; then
|
||||
# Test for non-global IPv4 address
|
||||
if ! ipv6_test_ipv4_addr_global_usable $ipv4addr; then
|
||||
net_log $"Given IPv4 address '$ipv4addr' is not globally usable" info
|
||||
valid6to4config="no"
|
||||
fi
|
||||
else
|
||||
net_log $"IPv6to4 configuration needs an IPv4 address on related interface or otherwise specified" info
|
||||
valid6to4config="no"
|
||||
fi
|
||||
if [ -z "$IPV6TO4_RELAY" ]; then
|
||||
IPV6TO4_RELAY="192.88.99.1"
|
||||
fi
|
||||
|
||||
# Check/generate relay address
|
||||
ipv6to4_relay="$(ipv6_create_6to4_relay_address $IPV6TO4_RELAY)"
|
||||
if [ $? -ne 0 ]; then
|
||||
valid6to4config="no"
|
||||
fi
|
||||
|
||||
if [ "$valid6to4config" = "yes" ]; then
|
||||
# Delete routes to local networks
|
||||
for devsuf in $IPV6TO4_ROUTING; do
|
||||
dev="${devsuf%%-*}"
|
||||
ipv6_cleanup_6to4_device $dev
|
||||
done
|
||||
|
||||
# Cleanup all old data (needed, if "ip-down.ipv6to4" wasn't executed), delete all configured 6to4 address
|
||||
ipv6_cleanup_6to4_tunnels tun6to4
|
||||
|
||||
# Get MTU of master device
|
||||
ipv4mtu="$(/sbin/ip link show dev $DEVICE | awk '/\<mtu\>/ { print $5 }')"
|
||||
if [ -n "$ipv4mtu" ]; then
|
||||
# IPv6 tunnel MTU is IPv4 MTU minus 20 for IPv4 header
|
||||
tunnelmtu=$[ $ipv4mtu - 20 ]
|
||||
fi
|
||||
|
||||
if [ -n "$IPV6TO4_MTU" ]; then
|
||||
if [ $IPV6TO4_MTU -gt $tunnelmtu ]; then
|
||||
net_log $"Warning: configured MTU '$IPV6TO4_MTU' for 6to4 exceeds maximum limit of '$tunnelmtu', ignored" warning
|
||||
else
|
||||
tunnelmtu=$IPV6TO4_MTU
|
||||
fi
|
||||
fi
|
||||
|
||||
# Setup new data
|
||||
ipv6_add_6to4_tunnel tun6to4 $ipv4addr "" $tunnelmtu || exit 1
|
||||
|
||||
# Add route to for compatible addresses (removed later again)
|
||||
ipv6_add_route "::/96" "::" tun6to4
|
||||
|
||||
# Add default route, if device matches
|
||||
if [ "$IPV6_DEFAULTDEV" = "tun6to4" ]; then
|
||||
if [ -n "$IPV6_DEFAULTGW" ]; then
|
||||
net_log $"Warning: interface 'tun6to4' does not support 'IPV6_DEFAULTGW', ignored" warning
|
||||
fi
|
||||
ipv6_set_default_route $ipv6to4_relay tun6to4
|
||||
fi
|
||||
|
||||
# Add static routes
|
||||
if [ -f /etc/sysconfig/static-routes-ipv6 ]; then
|
||||
LC_ALL=C grep -w "^tun6to4" /etc/sysconfig/static-routes-ipv6 | while read device network gateway; do
|
||||
if [ -z "$network" ]; then
|
||||
continue
|
||||
fi
|
||||
if [ -z "$gateway" ]; then
|
||||
gateway="$ipv6to4_relay"
|
||||
fi
|
||||
ipv6_add_route $network $gateway tun6to4
|
||||
done
|
||||
fi
|
||||
|
||||
# Setup additional static IPv6 routes (newer config style)
|
||||
if [ -f "/etc/sysconfig/network-scripts/route6-tun6to4" ]; then
|
||||
sed -ne 's/#.*//' -e '/[^[:space:]]/p' /etc/sysconfig/network-scripts/route6-tun6to4 | while read line; do
|
||||
if echo "$line" | grep -vq 'via'; then
|
||||
# Add gateway if missing
|
||||
line="$line via $ipv6to4_relay"
|
||||
fi
|
||||
/sbin/ip -6 route add $line
|
||||
done
|
||||
fi
|
||||
|
||||
# Cleanup autmatically generated autotunnel (not needed for 6to4)
|
||||
/sbin/ip -6 route del ::/96 dev tun6to4
|
||||
/sbin/ip -6 addr del tun6to4 "::$ipv4addr/128" dev tun6to4
|
||||
|
||||
if [ "$IPV6_CONTROL_RADVD" = "yes" ]; then
|
||||
# Control running radvd
|
||||
ipv6_trigger_radvd up "$IPV6_RADVD_TRIGGER_ACTION" $IPV6_RADVD_PIDFILE
|
||||
|
||||
if [ -n "$IPV6TO4_ROUTING" ]; then
|
||||
# Generate 6to4 address
|
||||
ipv6to4prefix="$(ipv6_create_6to4_prefix $ipv4addr)"
|
||||
if [ -n "$ipv6to4prefix" ]; then
|
||||
# Add IPv6 address to interface (required interface route will be set automatically)
|
||||
for devsuf in $IPV6TO4_ROUTING; do
|
||||
dev="${devsuf%%-*}"
|
||||
suf="$(echo $devsuf | awk -F- '{ print $2 }')"
|
||||
ipv6_add_addr_on_device ${dev} ${ipv6to4prefix}${suf}
|
||||
done
|
||||
else
|
||||
net_log $"Error occurred while calculating the IPv6to4 prefix"
|
||||
fi
|
||||
else
|
||||
net_log $"radvd control enabled, but config is not complete"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
70
ppp/ipv6-down
Executable file
70
ppp/ipv6-down
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# ipv6-down
|
||||
#
|
||||
# Called by pppd after IPV6CP/down was finished
|
||||
#
|
||||
# This file should not be modified -- make local changes to
|
||||
# /etc/ppp/ipv6-down.local instead
|
||||
#
|
||||
#
|
||||
# Taken from:
|
||||
# (P) & (C) 2001-2006 by Peter Bieringer <pb@bieringer.de>
|
||||
#
|
||||
# You will find more information on the initscripts-ipv6 homepage at
|
||||
# http://www.deepspace6.net/projects/initscripts-ipv6.html
|
||||
#
|
||||
# RHL integration assistance by Pekka Savola <pekkas@netcore.fi>
|
||||
#
|
||||
# Calling parameters:
|
||||
# $1: interface name
|
||||
# $6: logical interface name (set by pppd option ipparam)
|
||||
#
|
||||
# Version 2006-08-02
|
||||
#
|
||||
# Uses following information from /etc/sysconfig/network-scripts/ifcfg-$1:
|
||||
# IPV6INIT=yes|no: controls IPv6 configuration for this interface
|
||||
#
|
||||
|
||||
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||
export PATH
|
||||
|
||||
LOGDEVICE=$6
|
||||
REALDEVICE=$1
|
||||
|
||||
[ -f /etc/sysconfig/network ] || exit 0
|
||||
. /etc/sysconfig/network
|
||||
|
||||
cd /etc/sysconfig/network-scripts
|
||||
. ./network-functions
|
||||
|
||||
CONFIG=$LOGDEVICE
|
||||
[ -f "$CONFIG" ] || CONFIG=ifcfg-$CONFIG
|
||||
source_config
|
||||
|
||||
[ -f /etc/sysconfig/network-scripts/network-functions-ipv6 ] || exit 1
|
||||
. /etc/sysconfig/network-scripts/network-functions-ipv6
|
||||
|
||||
[ -x /etc/ppp/ipv6-down.local ] && /etc/ppp/ipv6-down.local "$@"
|
||||
|
||||
|
||||
if [ "$IPV6_CONTROL_RADVD" = "yes" ]; then
|
||||
# Control running radvd
|
||||
ipv6_trigger_radvd down "$IPV6_RADVD_TRIGGER_ACTION" $IPV6_RADVD_PIDFILE
|
||||
fi
|
||||
|
||||
# IPv6 test, no module loaded, exit if system is not IPv6-ready
|
||||
ipv6_test testonly || exit 0
|
||||
|
||||
# Test device status
|
||||
ipv6_test_device_status $REALDEVICE
|
||||
if [ $? != 0 -a $? != 11 ]; then
|
||||
# device doesn't exist or other problem occurs
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Delete all current configured IPv6 addresses on this interface
|
||||
ipv6_cleanup_device $REALDEVICE
|
||||
|
||||
exit 0
|
||||
112
ppp/ipv6-up
Executable file
112
ppp/ipv6-up
Executable file
@@ -0,0 +1,112 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# ipv6-up
|
||||
#
|
||||
# Called by pppd after IPV6CP/up was finished
|
||||
#
|
||||
# This file should not be modified -- make local changes to
|
||||
# /etc/ppp/ipv6-up.local instead
|
||||
#
|
||||
# Taken from:
|
||||
# (P) & (C) 2001-2006 by Peter Bieringer <pb@bieringer.de>
|
||||
#
|
||||
# You will find more information on the initscripts-ipv6 homepage at
|
||||
# http://www.deepspace6.net/projects/initscripts-ipv6.html
|
||||
#
|
||||
# RHL integration assistance by Pekka Savola <pekkas@netcore.fi>
|
||||
#
|
||||
# Calling parameters:
|
||||
# $1: interface name
|
||||
# $6: logical interface name (set by pppd option ipparam)
|
||||
#
|
||||
#
|
||||
# Version: 2006-08-02
|
||||
#
|
||||
# Uses following information from "/etc/sysconfig/network":
|
||||
# IPV6_DEFAULTDEV=<device>: controls default route (optional)
|
||||
#
|
||||
# Uses following information from "/etc/sysconfig/network-scripts/ifcfg-$1":
|
||||
# IPV6INIT=yes|no: controls IPv6 configuration for this interface
|
||||
# IPV6ADDR=<IPv6 address>[/<prefix length>]: specify primary static IPv6 address
|
||||
# IPV6ADDR_SECONDARIES="<IPv6 address>[/<prefix length>] ..." (optional)
|
||||
# IPV6_MTU=<MTU for IPv6>: controls IPv6 MTU for this link (optional)
|
||||
#
|
||||
|
||||
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||
export PATH
|
||||
|
||||
LOGDEVICE=$6
|
||||
REALDEVICE=$1
|
||||
|
||||
[ -f /etc/sysconfig/network ] || exit 0
|
||||
. /etc/sysconfig/network
|
||||
|
||||
cd /etc/sysconfig/network-scripts
|
||||
. ./network-functions
|
||||
. ./network-functions-ipv6
|
||||
|
||||
CONFIG=$LOGDEVICE
|
||||
[ -f "$CONFIG" ] || CONFIG=ifcfg-$CONFIG
|
||||
source_config
|
||||
|
||||
# Test whether IPv6 configuration is disabled for this interface
|
||||
[[ "$IPV6INIT" = [nN0]* ]] && exit 0
|
||||
|
||||
[ -f /etc/sysconfig/network-scripts/network-functions-ipv6 ] || exit 1
|
||||
. /etc/sysconfig/network-scripts/network-functions-ipv6
|
||||
|
||||
# IPv6 test, module loaded, exit if system is not IPv6-ready
|
||||
ipv6_test || exit 1
|
||||
|
||||
# Test device status
|
||||
ipv6_test_device_status $REALDEVICE
|
||||
if [ $? != 0 -a $? != 11 ]; then
|
||||
# device doesn't exist or other problem occurs
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Setup IPv6 address on specified interface
|
||||
if [ -n "$IPV6ADDR" ]; then
|
||||
ipv6_add_addr_on_device $REALDEVICE $IPV6ADDR || exit 1
|
||||
fi
|
||||
|
||||
# Set IPv6 MTU, if given
|
||||
if [ -n "$IPV6_MTU" ]; then
|
||||
ipv6_set_mtu $REALDEVICE $IPV6_MTU
|
||||
fi
|
||||
|
||||
# Setup additional IPv6 addresses from list, if given
|
||||
if [ -n "$IPV6ADDR_SECONDARIES" ]; then
|
||||
for ipv6addr in $IPV6ADDR_SECONDARIES; do
|
||||
ipv6_add_addr_on_device $REALDEVICE $ipv6addr
|
||||
done
|
||||
fi
|
||||
|
||||
# Setup default IPv6 route through device
|
||||
if [ "$IPV6_DEFAULTDEV" = "$LOGDEVICE" ]; then
|
||||
ipv6_set_default_route "" "$REALDEVICE" "$REALDEVICE"
|
||||
fi
|
||||
|
||||
# Setup additional static IPv6 routes on specified interface, if given
|
||||
if [ -f /etc/sysconfig/static-routes-ipv6 ]; then
|
||||
LC_ALL=C grep -w "^$LOGDEVICE" /etc/sysconfig/static-routes-ipv6 | while read device args; do
|
||||
ipv6_add_route $args $REALDEVICE
|
||||
done
|
||||
fi
|
||||
|
||||
# Setup additional static IPv6 routes (newer config style)
|
||||
if [ -f "/etc/sysconfig/network-scripts/route6-$DEVICE" ]; then
|
||||
sed -ne 's/#.*//' -e '/[^[:space:]]/p' "/etc/sysconfig/network-scripts/route6-$DEVICE" | while read line; do
|
||||
/sbin/ip -6 route add $line
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "$IPV6_CONTROL_RADVD" = "yes" ]; then
|
||||
# Control running radvd
|
||||
ipv6_trigger_radvd up "$IPV6_RADVD_TRIGGER_ACTION" $IPV6_RADVD_PIDFILE
|
||||
fi
|
||||
|
||||
[ -x /etc/ppp/ipv6-up.local ] && /etc/ppp/ipv6-up.local "$@"
|
||||
|
||||
exit 0
|
||||
1
ppp/options
Normal file
1
ppp/options
Normal file
@@ -0,0 +1 @@
|
||||
lock
|
||||
33
ppp/options.pptp
Normal file
33
ppp/options.pptp
Normal file
@@ -0,0 +1,33 @@
|
||||
# Lock the port
|
||||
lock
|
||||
|
||||
# Authentication
|
||||
noauth
|
||||
|
||||
# We won't do PAP, EAP, CHAP, or MSCHAP, but we will accept MSCHAP-V2
|
||||
refuse-pap
|
||||
refuse-eap
|
||||
refuse-chap
|
||||
refuse-mschap
|
||||
|
||||
# Compression
|
||||
# Turn off compression protocols we know won't be used
|
||||
nobsdcomp
|
||||
nodeflate
|
||||
|
||||
mtu 1496
|
||||
mru 1496
|
||||
#lcp-echo-interval 30
|
||||
# http://ppp.samba.org/ the PPP project version of PPP by Paul Mackarras
|
||||
# ppp-2.4.2 or later with MPPE only, kernel module ppp_mppe.o
|
||||
# {{{
|
||||
# Require MPPE 128-bit encryption
|
||||
#require-mppe-128
|
||||
# }}}
|
||||
|
||||
# http://polbox.com/h/hs001/ fork from PPP project by Jan Dubiec
|
||||
# ppp-2.4.2 or later with MPPE and MPPC, kernel module ppp_mppe_mppc.o
|
||||
# {{{
|
||||
# Require MPPE 128-bit encryption
|
||||
#mppe required,stateless
|
||||
# }}}
|
||||
59
ppp/options.pptp.rpmnew
Normal file
59
ppp/options.pptp.rpmnew
Normal file
@@ -0,0 +1,59 @@
|
||||
###############################################################################
|
||||
# $Id: options.pptp,v 1.3 2006/03/26 23:11:05 quozl Exp $
|
||||
#
|
||||
# Sample PPTP PPP options file /etc/ppp/options.pptp
|
||||
# Options used by PPP when a connection is made by a PPTP client.
|
||||
# This file can be referred to by an /etc/ppp/peers file for the tunnel.
|
||||
# Changes are effective on the next connection. See "man pppd".
|
||||
#
|
||||
# You are expected to change this file to suit your system. As
|
||||
# packaged, it requires PPP 2.4.2 or later from http://ppp.samba.org/
|
||||
# and the kernel MPPE module available from the CVS repository also on
|
||||
# http://ppp.samba.org/, which is packaged for DKMS as kernel_ppp_mppe.
|
||||
###############################################################################
|
||||
|
||||
# Lock the port
|
||||
lock
|
||||
|
||||
# Authentication
|
||||
# We don't need the tunnel server to authenticate itself
|
||||
noauth
|
||||
|
||||
# We won't do PAP, EAP, CHAP, or MSCHAP, but we will accept MSCHAP-V2
|
||||
# (you may need to remove these refusals if the server is not using MPPE)
|
||||
refuse-pap
|
||||
refuse-eap
|
||||
refuse-chap
|
||||
refuse-mschap
|
||||
|
||||
# Compression
|
||||
# Turn off compression protocols we know won't be used
|
||||
nobsdcomp
|
||||
nodeflate
|
||||
|
||||
# Encryption
|
||||
# (There have been multiple versions of PPP with encryption support,
|
||||
# choose which of the following sections you will use. Note that MPPE
|
||||
# requires the use of MSCHAP-V2 during authentication)
|
||||
#
|
||||
# Note that using PPTP with MPPE and MSCHAP-V2 should be considered
|
||||
# insecure:
|
||||
# http://marc.info/?l=pptpclient-devel&m=134372640219039&w=2
|
||||
# https://github.com/moxie0/chapcrack/blob/master/README.md
|
||||
# http://technet.microsoft.com/en-us/security/advisory/2743314
|
||||
|
||||
# http://ppp.samba.org/ the PPP project version of PPP by Paul Mackarras
|
||||
# ppp-2.4.2 or later with MPPE only, kernel module ppp_mppe.o
|
||||
# If the kernel is booted in FIPS mode (fips=1), the ppp_mppe.ko module
|
||||
# is not allowed and PPTP-MPPE is not available.
|
||||
# {{{
|
||||
# Require MPPE 128-bit encryption
|
||||
#require-mppe-128
|
||||
# }}}
|
||||
|
||||
# http://mppe-mppc.alphacron.de/ fork from PPP project by Jan Dubiec
|
||||
# ppp-2.4.2 or later with MPPE and MPPC, kernel module ppp_mppe_mppc.o
|
||||
# {{{
|
||||
# Require MPPE 128-bit encryption
|
||||
#mppe required,stateless
|
||||
# }}}
|
||||
34
ppp/options.pptpd
Normal file
34
ppp/options.pptpd
Normal file
@@ -0,0 +1,34 @@
|
||||
###############################################################################
|
||||
# $Id: options.pptpd,v 1.11 2005/12/29 01:21:09 quozl Exp $
|
||||
#
|
||||
# Sample Poptop PPP options file /etc/ppp/options.pptpd
|
||||
# Options used by PPP when a connection arrives from a client.
|
||||
# This file is pointed to by /etc/pptpd.conf option keyword.
|
||||
# Changes are effective on the next connection. See "man pppd".
|
||||
#
|
||||
# You are expected to change this file to suit your system. As
|
||||
# packaged, it requires PPP 2.4.2 and the kernel MPPE module.
|
||||
###############################################################################
|
||||
|
||||
# Authentication
|
||||
name pptpd
|
||||
#chapms-strip-domain
|
||||
|
||||
# Encryption
|
||||
refuse-pap
|
||||
refuse-chap
|
||||
refuse-mschap
|
||||
require-mschap-v2
|
||||
require-mppe-128
|
||||
|
||||
# Options
|
||||
proxyarp
|
||||
nobsdcomp
|
||||
nodeflate
|
||||
lock
|
||||
novj
|
||||
novjccomp
|
||||
nologfd
|
||||
|
||||
mtu 1496
|
||||
mru 1496
|
||||
2
ppp/pap-secrets
Normal file
2
ppp/pap-secrets
Normal file
@@ -0,0 +1,2 @@
|
||||
# Secrets for authentication using PAP
|
||||
# client server secret IP addresses
|
||||
12
ppp/peers/vpn_gazduire.ro
Normal file
12
ppp/peers/vpn_gazduire.ro
Normal file
@@ -0,0 +1,12 @@
|
||||
pty "pptp 188.214.17.18 --nolaunchpppd"
|
||||
connect /bin/true
|
||||
#nodetach
|
||||
logfd 2
|
||||
noproxyarp
|
||||
name bogdan.stoica
|
||||
remotename PPTP
|
||||
require-mppe-128
|
||||
mtu 1496
|
||||
mru 1496
|
||||
file /etc/ppp/options.pptp
|
||||
ipparam gazduire.ro
|
||||
Reference in New Issue
Block a user