Tinc som VPN-kobling mellom mesh-noder

Jesper Henriksen jesper at catnet.dk
Tue Dec 17 12:32:22 CET 2013


Tror nok at jeg har fått en fungerende openwrt oppskrift. Mangler bare
at dugnadsnett aksepterer min public key før jeg kan se om det funker :)

cat /etc/tinc/dugnadsnett_no/hosts/catnet
-----BEGIN RSA PUBLIC KEY-----
MIIBCgKCAQEA1FBDIc8vtc1CzyXsYEnEGs7n7qTF9KII3BXgJLJrZGKeSGn5amuA
xQ1xMHhnLAQvh7Eu0qgEqSMV23oj9YossN2JFVqoD8CNl8V9DYQUvOz9/qx78gDW
vGaQjfppydkzMVuJxvBaGo9RO2rwMlJ5gpnavheIe6PnD8oKzUVSiN20FJJeCSj6
O7I9/i36omiqO/oOzgzM7Th154X/D3zgMAmdz8FG5TVqMZ/r3y7ZEDxNd6mwor0W
F2Tn2odGi4PT4e/kUs5eTs1X54gJkpe3Vatl7O97gUVSi7oCqc4IEyiFrzM7RSyA
Gq+NqwhewW1qDfyrZ3Mwd7SNKcaXIRrLgwIDAQAB
-----END RSA PUBLIC KEY-----



Her er oppskriften (erstatt YourUniqueNodeName med eget valgt navn - resten
skal være copy/pastable):

opkg update
opkg install tinc
opkg files tinc

uci set tinc.dugnadsnett_no=tinc-net
uci set tinc.dugnadsnett_no.Name=YourUniqueNodeName
uci set tinc.dugnadsnett_no.Mode=switch
uci add_list tinc.dugnadsnett_no.ConnectTo=dugnadsnett
uci set tinc.dugnadsnett_no.enabled=1

uci set tinc.dugnadsnett=tinc-host
uci set tinc.dugnadsnett.net=dugnadsnett_no
uci add_list tinc.dugnadsnett.Address=dugnadsnett.nuug.no
uci set tinc.dugnadsnett.enabled=1

uci show tinc.dugnadsnett_no
uci show tinc.dugnadsnett

uci commit tinc

mkdir -p /etc/tinc/dugnadsnett_no/hosts
cat > /etc/tinc/dugnadsnett_no/hosts/dugnadsnett <<EOF
-----BEGIN RSA PUBLIC KEY-----
MIIBCgKCAQEAzMc/xK6eoUq4dA9+pkqS9FmhNXnFd3vXPhYHFU34jCCr0yfYKHs3
nhY9JjcCEYYd1qrAgHwR5cM6qiQVeunRXhY+Deg7xQx3eoT0DsyteKmnCrwTj2c2
kQ22HLJ0WWaorJbwA3Mizayq4Lm8sUlf3iI//zuM12DqauEO3fHzdbg6NqrROfnX
J6epEtTS7d1B2a7RG+9WND+JwZYj1konzXreMqW0L7x1T6QBuM06upaP3qnAN7eo
EfEP/Z4g3QcFCDmi9riSjGH83steO95SkbHj+HvL7l/yEWbaCHVcStmAkQPev4Fd
HG3nZfFdgSBLKUg0ifI9wTKHF+rEgClU5QIDAQAB
-----END RSA PUBLIC KEY-----
EOF

cat > /etc/tinc/dugnadsnett_no/action <<EOF
#!/bin/sh
ACTION="\$(basename "\$0")"

case "\$ACTION" in
        tinc-up)
                batctl if add "\$INTERFACE"
        ;;
        tinc-down)
                batctl if del "\$INTERFACE"
        ;;
esac
EOF
chmod 755 /etc/tinc/dugnadsnett_no/action
ln -s action /etc/tinc/dugnadsnett_no/tinc-up
ln -s action /etc/tinc/dugnadsnett_no/tinc-down

/etc/init.d/tinc enable
/etc/init.d/tinc start
logread; logread -f

Send indholdet av /etc/tinc/dugnadsnett_no/hosts/YourUniqueNodeName til
mailing listen.

Problemer? Prøv:

uci set tinc.dugnadsnett_no.debug=3
/etc/init.d/tinc restart
logread; logread -f

Etter feilsøk, sett eventuellt debug tilbake til 0.

-- 
Jesper Henriksen <http://www.catnet.dk/>


More information about the dugnadsnett mailing list