Skip to content

Instantly share code, notes, and snippets.

@DavidePrincipi
Last active July 12, 2017 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidePrincipi/5907bf4bc122e44c842ec46f66958829 to your computer and use it in GitHub Desktop.
Save DavidePrincipi/5907bf4bc122e44c842ec46f66958829 to your computer and use it in GitHub Desktop.
Configure NethServer 7 DC+VPNs on a dply.co VPS -- https://dply.co/b/h1hpfeRR
#!/bin/bash
export PATH="/sbin/e-smith:${PATH}"
NETWORKID=$(( $RANDOM % 32 + 103 ))
echo "Green network is 192.168.${NETWORKID}.0/24"
fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
yum localinstall -y http://mirror.nethserver.org/nethserver/nethserver-release-7.rpm
nethserver-install
yum install -y nethserver-dc nethserver-firewall-base-ui nethserver-openvpn nethserver-ipsec nethserver-ipsec-tunnels
db networks setprop eth0 role red
db networks set br0 bridge role green ipaddr 192.168.${NETWORKID}.1 netmask 255.255.255.0 gateway ''
db networks set eth0.500 vlan role bridged bridge br0
signal-event interface-update
DNSDOMAIN=$(hostname -d)
NBDOMAIN=$(hostname -d | cut -f 1 -d .)
config setprop sssd Realm "AD.${DNSDOMAIN^^}" Workgroup "${NBDOMAIN^^}"
config setprop nsdc IpAddress 192.168.${NETWORKID}.2 status enabled bridge br0
signal-event nethserver-dc-save
@DavidePrincipi
Copy link
Author

DavidePrincipi commented Jul 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment