-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: zhangzujian <[email protected]>
- Loading branch information
1 parent
ad73b1f
commit 181d247
Showing
45 changed files
with
2,746 additions
and
155 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
bfdd-control session new set mintx "${BFD_MIN_TX:-1000}" | ||
bfdd-control session new set minrx "${BFD_MIN_RX:-1000}" | ||
bfdd-control session new set multi "${BFD_MULTI:-3}" | ||
|
||
PEER_IPS=($(echo "${BFD_PEER_IPS:-::}" | tr ',' ' ')) | ||
for ip in ${PEER_IPS[*]}; do | ||
bfdd-control allow ${ip} | ||
done |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
INTERNAL_GATEWAY_IPV4=${INTERNAL_GATEWAY_IPV4:-} | ||
INTERNAL_GATEWAY_IPV6=${INTERNAL_GATEWAY_IPV6:-} | ||
INTERNAL_ROUTE_DST_IPV4=($(echo "${INTERNAL_ROUTE_DST_IPV4:-}" | tr ',' ' ')) | ||
INTERNAL_ROUTE_DST_IPV6=($(echo "${INTERNAL_ROUTE_DST_IPV6:-}" | tr ',' ' ')) | ||
SNAT_SOURCES_IPV4=($(echo "${SNAT_SOURCES_IPV4:-}" | tr ',' ' ')) | ||
SNAT_SOURCES_IPV6=($(echo "${SNAT_SOURCES_IPV6:-}" | tr ',' ' ')) | ||
|
||
sysctl -w net.ipv4.ip_forward=1 | ||
sysctl -w net.ipv6.conf.all.forwarding=1 | ||
|
||
for dst in ${INTERNAL_ROUTE_DST_IPV4[*]}; do | ||
ip route add "${dst}" via "${INTERNAL_GATEWAY_IPV4}" | ||
done | ||
|
||
for dst in ${INTERNAL_ROUTE_DST_IPV6[*]}; do | ||
ip route add "${dst}" via "${INTERNAL_GATEWAY_IPV6}" | ||
done | ||
|
||
for src in ${SNAT_SOURCES_IPV4[*]}; do | ||
iptables -t nat -A POSTROUTING -s "${src}" -j MASQUERADE --random-fully | ||
done | ||
|
||
for src in ${SNAT_SOURCES_IPV6[*]}; do | ||
ip6tables -t nat -A POSTROUTING -s "${src}" -j MASQUERADE --random-fully | ||
done |
Oops, something went wrong.