-
-
Save Madji/43d6ce4b439d7c17d7580bec8e16d411 to your computer and use it in GitHub Desktop.
tinc
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
ADDRESS=10.10.0.2 | |
CLIENT=$(hostname -s) | |
yum install -y epel-release | |
yum install -y tinc | |
mkdir -p /etc/tinc/hosts | |
cat >/etc/tinc/tinc.conf <<EOF | |
Name=$CLIENT | |
ConnectTo=vp1 | |
EOF | |
tincd -K </dev/null | |
sed -i "1i Subnet=$ADDRESS" /etc/tinc/hosts/$CLIENT | |
cat >/etc/tinc/tinc-up <<EOF | |
#!/bin/sh | |
ifconfig \$INTERFACE $ADDRESS netmask 255.255.255.0 | |
EOF | |
chmod u+x /etc/tinc/tinc-up | |
cat >>/etc/rc.d/rc.local <<'EOF' | |
tincd | |
EOF | |
cat /etc/tinc/hosts/$CLIENT |
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
ADDRESS=10.10.0.1 | |
SERVER=$(hostname -s) | |
yum install -y epel-release | |
yum install -y tinc | |
mkdir /etc/tinc | |
cat >/etc/tinc/tinc.conf <<EOF | |
Name=$SERVER | |
EOF | |
mkdir -p /etc/tinc/hosts | |
tincd -K </dev/null | |
sed -i "1i Subnet=$ADDRESS" /etc/tinc/hosts/$SERVER | |
cat >/etc/tinc/tinc-up <<EOF | |
#!/bin/sh | |
ifconfig \$INTERFACE $ADDRESS netmask 255.255.255.0 | |
EOF | |
chmod u+x /etc/tinc/tinc-up | |
cat >>/etc/rc.d/rc.local <<'EOF' | |
tincd | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment