Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
nextgen-router
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
nextgen-router
Commits
3e8a3ebb
Commit
3e8a3ebb
authored
Dec 13, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gravity
parent
cf703c3d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
files/bridge-post-scripts/post-up.sh.j2
files/bridge-post-scripts/post-up.sh.j2
+1
-1
files/ppp-post-scripts/postup.sh.j2
files/ppp-post-scripts/postup.sh.j2
+1
-1
files/utility.sh.j2
files/utility.sh.j2
+2
-2
No files found.
files/bridge-post-scripts/post-up.sh.j2
View file @
3e8a3ebb
...
@@ -43,7 +43,7 @@ handle_gateway() {
...
@@ -43,7 +43,7 @@ handle_gateway() {
ip rule add pref 100 fwmark
"
$GATEWAY_NEXT_HOP_MARK
"
lookup
"
$GATEWAY_NEXT_HOP_MARK
"
ip rule add pref 100 fwmark
"
$GATEWAY_NEXT_HOP_MARK
"
lookup
"
$GATEWAY_NEXT_HOP_MARK
"
ip rule add pref 400 fwmark
"
$GATEWAY_SELECTION_MARK
"
lookup
"
$GATEWAY_NEXT_HOP_MARK
"
ip rule add pref 400 fwmark
"
$GATEWAY_SELECTION_MARK
"
lookup
"
$GATEWAY_NEXT_HOP_MARK
"
if
[[
"
$GATEWAY_NO_ORIGIN
"
-eq
0
]]
;
then
if
[[
"
$GATEWAY_NO_ORIGIN
"
-eq
0
]]
;
then
eth_origin
-
A
"
$BRIDGE_NAME
"
"
$GATEWAY_ID
"
"
$GATEWAY_ADDRESS
"
"
$GATEWAY_MAC
"
eth_origin
-
I
"
$BRIDGE_NAME
"
"
$GATEWAY_ID
"
"
$GATEWAY_ADDRESS
"
"
$GATEWAY_MAC
"
fi
fi
}
}
...
...
files/ppp-post-scripts/postup.sh.j2
View file @
3e8a3ebb
...
@@ -38,6 +38,6 @@ fi
...
@@ -38,6 +38,6 @@ fi
cd
{{
ansible_user_dir
}}
/nextgen-router/services/dnsmasq
cd
{{
ansible_user_dir
}}
/nextgen-router/services/dnsmasq
docker-compose restart smartdns
docker-compose restart smartdns
ppp_origin
-
A
"
$PPP_IFACE
"
ppp_origin
-
I
"
$PPP_IFACE
"
true
true
files/utility.sh.j2
View file @
3e8a3ebb
...
@@ -12,9 +12,9 @@ ppp_origin() {
...
@@ -12,9 +12,9 @@ ppp_origin() {
OPTION=$1
OPTION=$1
INTERFACE=$2
INTERFACE=$2
MARK=$[1000 + $(echo "$INTERFACE" | sed "s/ppp//g")]
MARK=$[1000 + $(echo "$INTERFACE" | sed "s/ppp//g")]
restore_mark "$OPTION" "$MARK"
iptables -t mangle "$OPTION" PREROUTING ! -p ospf -i "$INTERFACE" -m set ! --match-set localnet src -j CONNMARK --set-xmark "$MARK"
iptables -t mangle "$OPTION" PREROUTING ! -p ospf -i "$INTERFACE" -m set ! --match-set localnet src -j CONNMARK --set-xmark "$MARK"
# ip6tables -t mangle "$OPTION" PREROUTING ! -p ospf -i "$INTERFACE" -j CONNMARK --set-xmark "$MARK"
# ip6tables -t mangle "$OPTION" PREROUTING ! -p ospf -i "$INTERFACE" -j CONNMARK --set-xmark "$MARK"
restore_mark "$OPTION" "$MARK"
}
}
initialize_ipset() {
initialize_ipset() {
...
@@ -42,7 +42,7 @@ eth_origin() {
...
@@ -42,7 +42,7 @@ eth_origin() {
NEIGH_LINE=$(ip neigh show "$GATEWAY_ADDRESS")
NEIGH_LINE=$(ip neigh show "$GATEWAY_ADDRESS")
GATEWAY_MAC=$(echo $NEIGH_LINE | awk '{print $5}')
GATEWAY_MAC=$(echo $NEIGH_LINE | awk '{print $5}')
fi
fi
restore_mark "$OPTION" "$MARK"
iptables -t mangle "$OPTION" PREROUTING ! -p ospf -i "$BRIDGE_NAME" -m mac --mac-source "$GATEWAY_MAC" -m set ! --match-set localnet src -j CONNMARK --set-xmark "$MARK"
iptables -t mangle "$OPTION" PREROUTING ! -p ospf -i "$BRIDGE_NAME" -m mac --mac-source "$GATEWAY_MAC" -m set ! --match-set localnet src -j CONNMARK --set-xmark "$MARK"
# ip6tables -t mangle "$OPTION" PREROUTING ! -p ospf -i "$BRIDGE_NAME" -m mac --mac-source "$GATEWAY_MAC" -m set ! --match-set localnet src -j CONNMARK --set-xmark "$MARK"
# ip6tables -t mangle "$OPTION" PREROUTING ! -p ospf -i "$BRIDGE_NAME" -m mac --mac-source "$GATEWAY_MAC" -m set ! --match-set localnet src -j CONNMARK --set-xmark "$MARK"
restore_mark "$OPTION" "$MARK"
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment