2020-05-11 20:10:33 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
IF="$1"
|
|
|
|
LOCAL_IP="$2"
|
|
|
|
PEER_IP="$3"
|
|
|
|
LOCAL_IPV6="$4"
|
|
|
|
PEER_IPV6="$5"
|
|
|
|
|
|
|
|
ip addr add "$LOCAL_IP" peer "$PEER_IP" dev "$IF"
|
2021-01-09 13:48:06 +08:00
|
|
|
|
|
|
|
if [ "$#" -ge 5 ]; then
|
|
|
|
ip addr add "$LOCAL_IPV6" peer "$PEER_IPV6" dev "$IF"
|
|
|
|
fi
|