Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gobengo/exitnode into dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
gobengo committed Feb 22, 2018
2 parents dcfd2b9 + c96152d commit 2b2e5d3
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 5 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,32 @@ Now edit the tunneldigger configuration by:
and change the list address from ```list address '45.34.140.42:8942'``` to ```list address '[exit node ip]:8942'```.

Now, execute ```reboot now``` to apply new changes.

## Test Domain Name Service (DNS)

To test DNS, connect to your home node using a laptop on the peoplesopen.net SSID . Now, on the commandline, execute something like ```dig @[ip of exit node] sudoroom.org``` to check whether the domain name resolution (DNS) work. DNS translates domain names into ip addresses.


```
$ dig @100.64.0.42 sudoroom.org
; <<>> DiG 9.9.5-9+deb8u15-Debian <<>> @100.64.0.42 sudoroom.org
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39878
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;sudoroom.org. IN A
;; ANSWER SECTION:
sudoroom.org. 2216 IN A 104.236.181.202
;; Query time: 25 msec
;; SERVER: 100.64.0.42#53(100.64.0.42)
;; WHEN: Sat Feb 17 21:15:57 EST 2018
;; MSG SIZE rcvd: 57
```
21 changes: 17 additions & 4 deletions create_exitnode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,29 @@ pip install netfilter
pip install virtualenv

TUNNELDIGGER_HOME=/opt/tunneldigger
git clone https://github.com/jhpoelen/tunneldigger.git $TUNNELDIGGER_HOME
git clone https://github.com/sudomesh/tunneldigger.git $TUNNELDIGGER_HOME
virtualenv $TUNNELDIGGER_HOME/broker/env_tunneldigger
$TUNNELDIGGER_HOME/broker/env_tunneldigger/bin/pip install -r $TUNNELDIGGER_HOME/broker/requirements.txt

cat > $TUNNELDIGGER_HOME/broker/scripts/up_hook.sh <<EOF
TUNNELDIGGER_UPHOOK_SCRIPT=$TUNNELDIGGER_HOME/broker/scripts/up_hook.sh
TUNNELDIGGER_DOWNHOOK_SCRIPT=$TUNNELDIGGER_HOME/broker/scripts/down_hook.sh

cat >$TUNNELDIGGER_UPHOOK_SCRIPT <<EOF
#!/bin/sh
echo "$(date) [td-hook] $*" >> /var/log/tunneldigger.log
ip link set \$3 up
ip addr add $MESH_IP/$MESH_PREFIX dev \$3
ip link set dev \$3 mtu \$4
babeld -a \$3
EOF

chmod 755 /opt/tunneldigger/broker/scripts/up_hook.sh
chmod 755 $TUNNELDIGGER_UPHOOK_SCRIPT

cat >$TUNNELDIGGER_DOWNHOOK_SCRIPT <<EOF
#!/bin/sh
babeld -x \$3
EOF

chmod 755 $TUNNELDIGGER_DOWNHOOK_SCRIPT

cat >/etc/babeld.conf <<EOF
redistribute local ip $MESH_IP/$MESH_PREFIX allow
Expand Down Expand Up @@ -96,6 +105,10 @@ sed -i.bak "s#interface=lo#interface=$ETH_IF#" $CFG

$EXITNODE_DIR/build/bin/set-public-ip $PUBLIC_IP

# for Digital Ocean only
sed -i 's/dns-nameservers.*/dns-nameservers 8.8.8.8/g' /etc/network/interfaces.d/50-cloud-init.cfg
sed -i '/address/a \ \ dns-nameservers 8.8.8.8' /etc/network/interfaces.d/50-cloud-init.cfg

# start babeld and tunnel digger on reboot
systemctl enable sudomesh-gateway
systemctl enable tunneldigger
Expand Down
2 changes: 1 addition & 1 deletion l2tp_broker.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ session.up=/opt/tunneldigger/broker/scripts/up_hook.sh
; Called just before the tunnel interface goes down
session.pre-down=
; Called after the tunnel interface goes down
session.down=
session.down=/opt/tunneldigger/broker/scripts/down_hook.sh
; Called after the tunnel MTU gets changed because of PMTU discovery
session.mtu-changed=

0 comments on commit 2b2e5d3

Please sign in to comment.