Last active
July 3, 2024 02:14
-
-
Save makotom/ef258109b6d41c076c53 to your computer and use it in GitHub Desktop.
Yet another implementation of IPv6 pass-through
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Replace the device names and the IPv6 prefix accordingly.