This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example Access Server Post-Auth script demonstrates three features: | |
# | |
# 1. How to set a connecting user's Access Server group based on LDAP | |
# group settings for the user. | |
# 2. How to verify that a given Access Server user only logs in using | |
# a known client machine. | |
# 3. How to verify that client machine contains up-to-date applications | |
# (such as virus checker) before allowing it to connect to the server. | |
# | |
# https://docs.openvpn.net/docs/access-server/openvpn-access-server-post-auth-scripting.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
NETCARD=eth0 | |
MAXBANDWIDTH=100000 | |
# reinit | |
tc qdisc del dev $NETCARD root handle 1 | |
tc qdisc add dev $NETCARD root handle 1: htb default 9999 | |
# create the default class | |
tc class add dev $NETCARD parent 1:0 classid 1:9999 htb rate $(( $MAXBANDWIDTH ))kbit ceil $(( $MAXBANDWIDTH ))kbit burst 5k prio 9999 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Stopping firewall and allowing everyone..." | |
iptables -F | |
iptables -X | |
iptables -t nat -F | |
iptables -t nat -X | |
iptables -t mangle -F | |
iptables -t mangle -X | |
iptables -P INPUT ACCEPT | |
iptables -P FORWARD ACCEPT |