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
b63bffc1
Commit
b63bffc1
authored
Feb 04, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix localnet ipset
parent
091d2266
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletion
+8
-1
files/bridge-post-scripts/post-up.sh.j2
files/bridge-post-scripts/post-up.sh.j2
+1
-0
files/initialize.sh.j2
files/initialize.sh.j2
+1
-1
files/utility.sh.j2
files/utility.sh.j2
+6
-0
No files found.
files/bridge-post-scripts/post-up.sh.j2
View file @
b63bffc1
...
@@ -57,6 +57,7 @@ handle_gateway {{gateway.id}} {{gateway.address}} {% if gateway.mac is defined a
...
@@ -57,6 +57,7 @@ handle_gateway {{gateway.id}} {{gateway.address}} {% if gateway.mac is defined a
{
%
if
br.masq is defined and br.masq %
}
{
%
if
br.masq is defined and br.masq %
}
# Masquerade
# Masquerade
ensure_localnet_ipset
iptables
-t
nat
-A
POSTROUTING
-o
"
$BRIDGE_NAME
"
-m
set
--match-set
localnet src
-m
set
!
--match-set
localnet dst
-j
MASQUERADE
iptables
-t
nat
-A
POSTROUTING
-o
"
$BRIDGE_NAME
"
-m
set
--match-set
localnet src
-m
set
!
--match-set
localnet dst
-j
MASQUERADE
{
% endif %
}
{
% endif %
}
...
...
files/initialize.sh.j2
View file @
b63bffc1
#!/bin/bash
#!/bin/bash
source
{{
ansible_user_dir
}}
/nextgen-router/scripts/utility.sh
source
{{
ansible_user_dir
}}
/nextgen-router/scripts/utility.sh
ipset restore
-f
{{
ansible_user_dir
}}
/nextgen-router/localnet-
ipset
ensure_localnet_
ipset
iptables-restore
--noflush
{{
ansible_user_dir
}}
/iptables-gateways
iptables-restore
--noflush
{{
ansible_user_dir
}}
/iptables-gateways
{
%
for
subnet
in
localnets %
}
{
%
for
subnet
in
localnets %
}
ip rule add pref 80 to
{{
subnet
}}
lookup main
ip rule add pref 80 to
{{
subnet
}}
lookup main
...
...
files/utility.sh.j2
View file @
b63bffc1
ensure_localnet_ipset() {
ipset restore -f {{ansible_user_dir}}/nextgen-router/localnet-ipset
}
restore_mark() {
restore_mark() {
OPTION=$1
OPTION=$1
MARK=$2
MARK=$2
...
@@ -12,6 +16,7 @@ restore_mark() {
...
@@ -12,6 +16,7 @@ restore_mark() {
}
}
ppp_origin() {
ppp_origin() {
ensure_localnet_ipset
OPTION=$1
OPTION=$1
INTERFACE=$2
INTERFACE=$2
MARK=$[1000 + $(echo "$INTERFACE" | sed "s/ppp//g")]
MARK=$[1000 + $(echo "$INTERFACE" | sed "s/ppp//g")]
...
@@ -21,6 +26,7 @@ ppp_origin() {
...
@@ -21,6 +26,7 @@ ppp_origin() {
}
}
eth_origin() {
eth_origin() {
ensure_localnet_ipset
OPTION=$1
OPTION=$1
BRIDGE_NAME=$2
BRIDGE_NAME=$2
GATEWAY_ID=$3
GATEWAY_ID=$3
...
...
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