Skip to content

Instantly share code, notes, and snippets.

@thomasschaeferm
Created October 29, 2019 21:05
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasschaeferm/eead9a77b6402086c8bb2554de8cc425 to your computer and use it in GitHub Desktop.
Save thomasschaeferm/eead9a77b6402086c8bb2554de8cc425 to your computer and use it in GitHub Desktop.
jool clat for 464xlat script
#!/bin/bash
PREFIX="$1"
IFACE="$2"
ip netns add jool
ip link add name to_jool typ veth peer name to_world
ip link set up dev to_jool
ip link set dev to_world netns jool
ip netns exec jool ip link set up dev to_world
ip -6 address add scope link fe80::1/64 dev to_jool
ip netns exec jool ip -6 address add scope link fe80::2/64 dev to_world
ip netns exec jool ip -6 route add default via fe80::1 dev to_world
ip netns exec jool ip -4 address add 192.0.0.2/29 dev to_world
echo 1 > /proc/sys/net/ipv6/conf/${IFACE}/proxy_ndp
ip -6 neigh add proxy ${PREFIX}::4646 dev ${IFACE}
ip -6 route add ${PREFIX}::4646 via fe80::2 dev to_jool
ip -4 address add 192.0.0.1/29 dev to_jool
ip -4 route add default via 192.0.0.2 dev to_jool
echo 1 | tee /proc/sys/net/ipv6/conf/*/forwarding
ip netns exec jool modprobe jool_siit
ip netns exec jool jool_siit instance add --netfilter -6 64:ff9b::/96
ip netns exec jool jool_siit eamt add 192.0.0.1 ${PREFIX}::4646
@thomasschaeferm
Copy link
Author

for use in a single /64 e.g. when connected to LTE, don't use it at WIFI, in case a other user uses the same script, the clat ipv6 address isn't randomized here

@omarcosr
Copy link

Could this be done without jool_siit?

@thomasschaeferm
Copy link
Author

I am not sure if the script still works, since jool is still under heavy development.
But to your question, the answer is no.
Something has to do the translation. jool_siit, tayga or tundra-nat64 or an other app or kernel module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment