initial commit master
authorRob <robin@robinkrens.nl>
Sun, 29 Apr 2018 09:09:45 +0000 (17:09 +0800)
committerRob <robin@robinkrens.nl>
Sun, 29 Apr 2018 09:09:45 +0000 (17:09 +0800)
14 files changed:
firewall-cfg.sh [new file with mode: 0755]
gatewayvpn-client/hosts/alpha [new file with mode: 0644]
gatewayvpn-client/hosts/beta [new file with mode: 0644]
gatewayvpn-client/rsa_key.priv [new file with mode: 0644]
gatewayvpn-client/tinc-down [new file with mode: 0755]
gatewayvpn-client/tinc-up [new file with mode: 0755]
gatewayvpn-client/tinc.conf [new file with mode: 0644]
gatewayvpn-server/hosts/alpha [new file with mode: 0644]
gatewayvpn-server/hosts/beta [new file with mode: 0644]
gatewayvpn-server/rsa_key.priv [new file with mode: 0644]
gatewayvpn-server/tinc-down [new file with mode: 0755]
gatewayvpn-server/tinc-up [new file with mode: 0755]
gatewayvpn-server/tinc.conf [new file with mode: 0644]
tinc-sample-conf-0.0.1.tar.gz [new file with mode: 0644]

diff --git a/firewall-cfg.sh b/firewall-cfg.sh
new file mode 100755 (executable)
index 0000000..f400a45
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+# enable IPv4 forwarding
+# set masquerade rule
+
+echo "Enabling IPv4 forwarding"
+echo 1 >/proc/sys/net/ipv4/ip_forward
+echo "Appending Masquerade rule to iptables"
+iptables -t nat -A POSTROUTING -s 172.16.16.0/255.255.255.0 -o ens3 -j MASQUERADE
+
diff --git a/gatewayvpn-client/hosts/alpha b/gatewayvpn-client/hosts/alpha
new file mode 100644 (file)
index 0000000..aee149f
--- /dev/null
@@ -0,0 +1,12 @@
+Address = 45.76.159.1
+Port = 7999
+Subnet = 0.0.0.0/0 
+
+-----BEGIN RSA PUBLIC KEY-----
+MIIBCgKCAQEAsUCMwlnU/YeWlLpUCJLguLZ9YeDku07oUYSwgpeIxVKgDSYdM2kw
+fmmnCr1DcHRIEFm8sxbfr/xzr3O/kBgeMQvEbAJibH5N80hK0pRL4CMjSjOuy4gy
+t5rMgj5c+S3c04Zs3ljJQFqh72/LhlfLzwviN5pqDxnvdQ8ZPU4xUz0thNcaHKXc
+huS0DK44jzjoKbeF8RZ5BkNhB5fqUxemji9TBe8jzr61A6+J8uMCfSlS2PyL0f8q
+KcMxy7Wb8d+BW/59PzyzUNvH2IZIanGuhnTtR+eci0SsnMOKwkZcqrD26hVIeLkM
+ifNo3DWXFcceaG6xKSocOe0mBh9Q3h4thQIDAQAB
+-----END RSA PUBLIC KEY-----
diff --git a/gatewayvpn-client/hosts/beta b/gatewayvpn-client/hosts/beta
new file mode 100644 (file)
index 0000000..e2247d2
--- /dev/null
@@ -0,0 +1,11 @@
+Port = 7999
+Subnet = 172.16.16.2/32
+
+-----BEGIN RSA PUBLIC KEY-----
+MIIBCgKCAQEAutRdN0yXhoZLMsBhcBMF3L7sQwouWtI8nZvNMnG4Wl/A93JIsTC4
+R5NjJJcKI+eeYiz/cPnWKLWc/iaUaLWnPuUnL8GYNfTC6V1b/N4PspKuIFaZeNkJ
+0XsuffHCGsKGBJNPB7eQJFovdCuK0fAsrcy2Y1u2OOsO8sdkK/XOcYM5aeKVHHcO
+a1HCPG1VX0SlR+gicllNZ/awp16Rjxce7lPnP1/gxTDQCEWYtPWITZZdFDfR57JW
+Nhr6sWKqIIWlnWl+1c7AkAzXpx/hxzyd18uHFEoO80F+IaVvaswxolHdqMlpAyWM
+LIXk7aoMgmyR73Ro0ku38NXMJmCYQJgQPQIDAQAB
+-----END RSA PUBLIC KEY-----
diff --git a/gatewayvpn-client/rsa_key.priv b/gatewayvpn-client/rsa_key.priv
new file mode 100644 (file)
index 0000000..f13afe9
--- /dev/null
@@ -0,0 +1,6 @@
+
+-----BEGIN RSA PRIVATE KEY-----
+
+! create your own private key using tincd -n VPNNAME -K
+
+-----END RSA PRIVATE KEY-----
diff --git a/gatewayvpn-client/tinc-down b/gatewayvpn-client/tinc-down
new file mode 100755 (executable)
index 0000000..fae013c
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+ip addr del 172.16.16.2/24 dev $INTERFACE
+ip link set $INTERFACE down
+
+ORIGINAL_GATEWAY=`ip route show | grep ^default | cut -d ' ' -f 2-5`
+REMOTEADDRESS=45.76.159.1
+
+ip route del $REMOTEADDRESS $ORIGINAL_GATEWAY
+ip route del $VPN_GATEWAY dev $INTERFACE
+ip route del 0.0.0.0/1 dev $INTERFACE
+ip route del 128.0.0.0/1 dev $INTERFACE
diff --git a/gatewayvpn-client/tinc-up b/gatewayvpn-client/tinc-up
new file mode 100755 (executable)
index 0000000..bc6cb77
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+ip link set $INTERFACE up
+ip addr add 172.16.16.2/24 dev $INTERFACE
+
+VPN_GATEWAY=172.16.16.1
+ORIGINAL_GATEWAY=`ip route show | grep ^default | cut -d ' ' -f 2-5`
+REMOTEADDRESS=45.76.159.1
+
+ip route add $REMOTEADDRESS $ORIGINAL_GATEWAY
+ip route add $VPN_GATEWAY dev $INTERFACE
+ip route add 0.0.0.0/1 via $VPN_GATEWAY dev $INTERFACE
+ip route add 128.0.0.0/1 via $VPN_GATEWAY dev $INTERFACE
diff --git a/gatewayvpn-client/tinc.conf b/gatewayvpn-client/tinc.conf
new file mode 100644 (file)
index 0000000..ce22603
--- /dev/null
@@ -0,0 +1,3 @@
+Name = beta
+Device = /dev/net/tun
+ConnectTo = alpha
diff --git a/gatewayvpn-server/hosts/alpha b/gatewayvpn-server/hosts/alpha
new file mode 100644 (file)
index 0000000..aee149f
--- /dev/null
@@ -0,0 +1,12 @@
+Address = 45.76.159.1
+Port = 7999
+Subnet = 0.0.0.0/0 
+
+-----BEGIN RSA PUBLIC KEY-----
+MIIBCgKCAQEAsUCMwlnU/YeWlLpUCJLguLZ9YeDku07oUYSwgpeIxVKgDSYdM2kw
+fmmnCr1DcHRIEFm8sxbfr/xzr3O/kBgeMQvEbAJibH5N80hK0pRL4CMjSjOuy4gy
+t5rMgj5c+S3c04Zs3ljJQFqh72/LhlfLzwviN5pqDxnvdQ8ZPU4xUz0thNcaHKXc
+huS0DK44jzjoKbeF8RZ5BkNhB5fqUxemji9TBe8jzr61A6+J8uMCfSlS2PyL0f8q
+KcMxy7Wb8d+BW/59PzyzUNvH2IZIanGuhnTtR+eci0SsnMOKwkZcqrD26hVIeLkM
+ifNo3DWXFcceaG6xKSocOe0mBh9Q3h4thQIDAQAB
+-----END RSA PUBLIC KEY-----
diff --git a/gatewayvpn-server/hosts/beta b/gatewayvpn-server/hosts/beta
new file mode 100644 (file)
index 0000000..e2247d2
--- /dev/null
@@ -0,0 +1,11 @@
+Port = 7999
+Subnet = 172.16.16.2/32
+
+-----BEGIN RSA PUBLIC KEY-----
+MIIBCgKCAQEAutRdN0yXhoZLMsBhcBMF3L7sQwouWtI8nZvNMnG4Wl/A93JIsTC4
+R5NjJJcKI+eeYiz/cPnWKLWc/iaUaLWnPuUnL8GYNfTC6V1b/N4PspKuIFaZeNkJ
+0XsuffHCGsKGBJNPB7eQJFovdCuK0fAsrcy2Y1u2OOsO8sdkK/XOcYM5aeKVHHcO
+a1HCPG1VX0SlR+gicllNZ/awp16Rjxce7lPnP1/gxTDQCEWYtPWITZZdFDfR57JW
+Nhr6sWKqIIWlnWl+1c7AkAzXpx/hxzyd18uHFEoO80F+IaVvaswxolHdqMlpAyWM
+LIXk7aoMgmyR73Ro0ku38NXMJmCYQJgQPQIDAQAB
+-----END RSA PUBLIC KEY-----
diff --git a/gatewayvpn-server/rsa_key.priv b/gatewayvpn-server/rsa_key.priv
new file mode 100644 (file)
index 0000000..5ac67bb
--- /dev/null
@@ -0,0 +1,3 @@
+
+-----BEGIN RSA PRIVATE KEY-----
+-----END RSA PRIVATE KEY-----
diff --git a/gatewayvpn-server/tinc-down b/gatewayvpn-server/tinc-down
new file mode 100755 (executable)
index 0000000..af8c971
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+ip addr del 172.16.16.1/24 dev $INTERFACE
+ip link set $INTERFACE down
diff --git a/gatewayvpn-server/tinc-up b/gatewayvpn-server/tinc-up
new file mode 100755 (executable)
index 0000000..6ced028
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+ip link set $INTERFACE up
+ip addr add  172.16.16.1/24 dev $INTERFACE
diff --git a/gatewayvpn-server/tinc.conf b/gatewayvpn-server/tinc.conf
new file mode 100644 (file)
index 0000000..579f0b5
--- /dev/null
@@ -0,0 +1,2 @@
+Name = alpha
+Device = /dev/net/tun
diff --git a/tinc-sample-conf-0.0.1.tar.gz b/tinc-sample-conf-0.0.1.tar.gz
new file mode 100644 (file)
index 0000000..6646383
Binary files /dev/null and b/tinc-sample-conf-0.0.1.tar.gz differ