mirror of
https://github.com/Ysurac/openmptcprouter-vps.git
synced 2025-03-09 15:50:00 +00:00
Add 6in4 support
This commit is contained in:
parent
a4b8cebbd1
commit
dcf20947f2
13 changed files with 142 additions and 17 deletions
27
omr-6in4
Executable file
27
omr-6in4
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ ! -f "$1" ]; then
|
||||
echo "usage: $(basename "$0") FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
. "$(readlink -f "$1")"
|
||||
|
||||
if [ "$2" = "start" ]; then
|
||||
if [ "$IPV6" = true ]; then
|
||||
# Add IPv6 tunnel
|
||||
if [ "$(ip link show omr-6in4 up)" ]; then
|
||||
ip tunnel change omr-6in4 mode sit remote 10.0.0.2 local 10.0.0.1
|
||||
else
|
||||
ip tunnel add omr-6in4 mode sit remote 10.0.0.2 local 10.0.0.1
|
||||
fi
|
||||
ip link set omr-6in4 up
|
||||
ip route replace fd00::/8 via fe80::a00:2 dev omr-6in4
|
||||
fi
|
||||
elif [ "$(ip link show omr-6in4 up)" ]; then
|
||||
ip route del fd00::/8 via fe80::a00:2 dev omr-6in4
|
||||
ip link set omr-6in4 down
|
||||
ip tunnel del omr-6in4
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue