From 32a78e4c844717c73eac5fdb38ce39824bb115c1 Mon Sep 17 00:00:00 2001 From: KemoNine Date: Fri, 18 Jan 2019 13:58:25 -0500 Subject: [PATCH] Add clat/ipv6 only notes to lte modem docs --- hardware/clat.md | 84 ++++++++++++++++++++++++++++++++++++++++ hardware/quectel_ec25.md | 67 +++++++++++++++++++++++++++----- hardware/rfc7050.py | 78 +++++++++++++++++++++++++++++++++++++ 3 files changed, 220 insertions(+), 9 deletions(-) create mode 100644 hardware/clat.md create mode 100644 hardware/rfc7050.py diff --git a/hardware/clat.md b/hardware/clat.md new file mode 100644 index 0000000..2b68316 --- /dev/null +++ b/hardware/clat.md @@ -0,0 +1,84 @@ +# Inspiration / Further Reading + +- [http://jool.mx/en/464xlat.html](http://jool.mx/en/464xlat.html) +- [https://tools.ietf.org/html/draft-ietf-behave-nat64-discovery-heuristic-17](https://tools.ietf.org/html/draft-ietf-behave-nat64-discovery-heuristic-17) +- [https://sites.google.com/site/tmoipv6/464xlat](https://sites.google.com/site/tmoipv6/464xlat) +- [http://jool.mx/en/install.html](http://jool.mx/en/install.html) +- [https://github.com/NICMx/Jool/](https://github.com/NICMx/Jool/) +- [https://hveem.no/using-dnsmasq-for-dhcpv6](https://hveem.no/using-dnsmasq-for-dhcpv6) +- [https://github.com/toreanderson/clatd](https://github.com/toreanderson/clatd) +- [http://jool.mx/en/run-vanilla.html#sample-network](http://jool.mx/en/run-vanilla.html#sample-network) +- [http://jool.mx/en/eamt.html](http://jool.mx/en/eamt.html) +- [http://jool.mx/en/run-eam.html](http://jool.mx/en/run-eam.html) +- [https://partiallydisassembled.wordpress.com/2017/04/14/pi-nat64/](https://partiallydisassembled.wordpress.com/2017/04/14/pi-nat64/) + +# Install Jool + +``` bash + +# If using raspbian be sure linux-headers package(s) +apt install build-essential pkg-config libnl-genl-3-dev libxtables-dev dkms git autoconf tar + +git clone https://github.com/NICMx/Jool.git /scratch/jool +cd /scratch/jool +git checkout `git tag | sort -r | head -n1` +dkms install ./ +./autogen.sh +./configure +cd src/usr +make +make install + +``` + +# Figure out NAT64 endpoints via RFC7050 + +See ```quectel_ec25.md``` for details + +# Figure out address mapping setup + +Look at your ipv6 address, pray for a /64 and do some mappings... + +``` + +2607:fb90:88bd:95b9:999e:f533:32e4:71fa/64 + -> 2607:fb90:88bd:95b9:: + -> 2607:fb90:88bd:95b9::172.17.17.17/120 + +``` + +# Setup jool routing for ipv4 <> ipv6 + +``` +sysctl -w net.ipv4.conf.all.forwarding=1 +sysctl -w net.ipv6.conf.all.forwarding=1 +modprobe jool_siit +jool_siit instance add "lollipop" --iptables --pool6 2607:7700:0:26::/96 # pool6 is NAT64 endpoints via RFC7050 +jool_siit instance display +jool_siit -i "lollipop" eamt add "2607:fb90:88bd:95b9::172.17.17.0/120" "172.17.17.0/24" # ipv6 address map <> ipv4 lan +jool_siit -i "lollipop" eamt display + +jool_siit -i "lollipop" stats display --all | less + +ip6tables -t mangle -A PREROUTING \ + -s 2607:fb90:88bd:95b9::172.17.17.0/120 \ + -j JOOL_SIIT --instance "lollipop" +iptables -t mangle -A PREROUTING \ + -s 172.17.17.0/24 \ + -j JOOL_SIIT --instance "lollipop" +ip6tables -I OUTPUT -d 2607:7700:0:26::/96 -j ACCEPT + +``` + +The iptables commands above were adapted from this block of the jool.mx docs + +``` + +user@T:~# ip6tables -t mangle -A PREROUTING \ +> -s 2001:db8::198.51.100.8/125 -d 2001:db8::192.0.2.0/120 \ +> -j JOOL_SIIT --instance "example" +user@T:~# iptables -t mangle -A PREROUTING \ +> -s 192.0.2.0/24 -d 198.51.100.8/29 \ +> -j JOOL_SIIT --instance "example" + +``` diff --git a/hardware/quectel_ec25.md b/hardware/quectel_ec25.md index dbf00f7..6451d1c 100644 --- a/hardware/quectel_ec25.md +++ b/hardware/quectel_ec25.md @@ -19,15 +19,7 @@ Only perform these steps and operations if you *must* have a Quectel EC25 and ca - [https://sixfab.com/updated-tutorial-3-make-a-ppp-internet-connection-with-3g-4glte-shields-on-raspberry-pi/](https://sixfab.com/updated-tutorial-3-make-a-ppp-internet-connection-with-3g-4glte-shields-on-raspberry-pi/) - [https://sixfab.com/product/quectel-ec25-mini-pcle-4glte-module/](https://sixfab.com/product/quectel-ec25-mini-pcle-4glte-module/) - [https://sixfab.com/gps-tracker-with-3g-4glte-shield/](https://sixfab.com/gps-tracker-with-3g-4glte-shield/) - - - - - - - - - +- [https://tools.ietf.org/html/draft-ietf-behave-nat64-discovery-heuristic-17](https://tools.ietf.org/html/draft-ietf-behave-nat64-discovery-heuristic-17) # Setup Apt Repos @@ -88,3 +80,60 @@ cgps 127.0.0.1:2948 # the "usual" way we like to monitor gps status # Add -n -D 3 to options (for debugging) ``` + +# NAT64 + DNS64 + +If you find yourself on a pure ipv6 network with NAT64/DNS64 deployed, you'll need the following breadcrumbs and information to get things online. + +This section is a Work In Progress and not 100% working. Help Welcome. + +## Figure out NAT64 endpoints via RFC7050 + +This may or may not be deployed on your carrier's network. Start here for decyphering NAT64 prefixes. + +``` bash + +host ipv4only.arpa +ipv4only.arpa has address 192.0.0.170 +ipv4only.arpa has address 192.0.0.171 +ipv4only.arpa has IPv6 address 2607:7700:0:26::c000:aa +ipv4only.arpa has IPv6 address 2607:7700:0:26::c000:ab +ping 2607:7700:0:26::8.8.8.8 + +``` + +## Figure out NAT64 endpoints w/o RFC7050 + +See the ```rfc7050.py``` script and ajust it lightly to look for an ipv4 only DNS record so the prefix can be found programatically by the rest of the script. + +## Turn on DNS64 in Unbound + +You'll need an additional include line in the config *above* the existing one for ```/etc/unbound/dns64.conf```. + +``` bash + +cat > /etc/unbound/dns64.conf < /etc/unbound/dns64.conf <