Skip to content

Instantly share code, notes, and snippets.

@makotom
Last active June 17, 2016 04:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makotom/ef258109b6d41c076c53 to your computer and use it in GitHub Desktop.
Save makotom/ef258109b6d41c076c53 to your computer and use it in GitHub Desktop.
Yet another implementation of IPv6 pass-through
#/usr/bin/bash
WANDEV='eth0'
LANDEV='br0'
while :
do
ip -6 neigh show dev $LANDEV | grep lladdr | grep -v -P ^fe80:: | sed -e 's/ .*$//' | while read addr
do
if [ "$(ip -6 neigh show proxy to $addr dev $WANDEV)" == "" ]
then
ip -6 neigh add proxy $addr dev $WANDEV
fi
done
ip -6 neigh show proxy dev $WANDEV | sed -e 's/ .*$//' | while read addr
do
if [ "$(ip -6 neigh show $addr dev $LANDEV)" == "" ]
then
ip -6 neigh del proxy $addr dev $WANDEV
fi
done
sleep 0.5
done
@makotom
Copy link
Author

makotom commented Sep 7, 2015

Replace the device names and the IPv6 prefix accordingly.

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