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
8f0c125f
Commit
8f0c125f
authored
Dec 08, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add direct
parent
09f822aa
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
1 deletion
+15
-1
files/bridge-post-scripts/post-down.sh.j2
files/bridge-post-scripts/post-down.sh.j2
+1
-1
files/bridge-post-scripts/pre-up.sh.j2
files/bridge-post-scripts/pre-up.sh.j2
+2
-0
files/interfaces.j2
files/interfaces.j2
+2
-0
files/ppp-macvlan-scripts/post-down.sh.j2
files/ppp-macvlan-scripts/post-down.sh.j2
+2
-0
files/ppp-macvlan-scripts/pre-up.sh.j2
files/ppp-macvlan-scripts/pre-up.sh.j2
+2
-0
files/pppoe-provider.j2
files/pppoe-provider.j2
+4
-0
variables.yaml
variables.yaml
+2
-0
No files found.
files/bridge-post-scripts/post-down.sh.j2
View file @
8f0c125f
...
...
@@ -3,7 +3,7 @@
source
{{
ansible_user_dir
}}
/nextgen-router/scripts/utility.sh
export
BRIDGE_NAME
={{
br.name
}}
{
%
if
br.macvlan is defined and br.macvlan %
}
{
%
if
br.macvlan is defined and br.macvlan
and br.links is defined and br.links and br.links | length
>
0
%
}
# macvlans
{
%
for
link
in
br.links %
}
...
...
files/bridge-post-scripts/pre-up.sh.j2
View file @
8f0c125f
...
...
@@ -7,6 +7,7 @@ export BRIDGE_NAME={{br.name}}
{{
br.linkUp
}}
{
% endif %
}
{
%
if
br.links is defined and br.links and br.links | length
>
0 %
}
{
%
for
link
in
br.links %
}
# link {{link}}
...
...
@@ -19,5 +20,6 @@ ip link add link {{link}} dev {{br.name}}{{link | regex_replace('\.', '')}} type
ip
link set
{{
br.name
}}{{
link
| regex_replace
(
'\.'
,
''
)}}
up
{
% endif %
}
{
% endfor %
}
{
% endif %
}
true
files/interfaces.j2
View file @
8f0c125f
...
...
@@ -83,6 +83,7 @@ iface {{vlan.link}}.{{vlan.tag}} inet6 manual
auto {{br.name}}
allow-hotplug {{br.name}}
iface {{br.name}} inet {{br.type}}
{% if not (br.direct is defined and br.direct) %}
{% if br.links is defined and br.links and br.links | length > 0 %}
bridge_ports{% for link in br.links %} {% if br.macvlan is defined and br.macvlan %}{{br.name}}{{link | regex_replace('\.', '')}}{% else %}{{link}}{% endif %}{% endfor %}
...
...
@@ -95,6 +96,7 @@ bridge_stp on
bridge_stp off
{% endif %}
bridge_maxwait 3
{% endif %}
{% if br.type == "static" %}
address {{br.address}}
{% elif br.type == "dhcp" %}
...
...
files/ppp-macvlan-scripts/post-down.sh.j2
View file @
8f0c125f
#!/bin/bash
{
%
if
not
(
ppp.direct is defined and ppp.direct
)
%
}
ip
link
del dev pppm
{{
ppp.id
}}
{
% endif %
}
files/ppp-macvlan-scripts/pre-up.sh.j2
View file @
8f0c125f
...
...
@@ -3,8 +3,10 @@ source {{ansible_user_dir}}/nextgen-router/scripts/utility.sh
_wait_for_interface_online
{{
ppp.link
}}
{
%
if
not
(
ppp.direct is defined and ppp.direct
)
%
}
ip
link
add
link
{{
ppp.link
}}
dev pppm
{{
ppp.id
}}
type
macvlan
ip
link set
pppm
{{
ppp.id
}}
up
{
%
if
ppp.mac is defined and ppp.mac %
}
ip
link set
pppm
{{
ppp.id
}}
address
{{
ppp.mac
}}
{
% endif %
}
{
% endif %
}
files/pppoe-provider.j2
View file @
8f0c125f
...
...
@@ -4,7 +4,11 @@ noauth
persist
maxfail 0
holdoff 5
{% if ppp.direct is defined and ppp.direct %}
plugin rp-pppoe.so {{ppp.link}}
{% else %}
plugin rp-pppoe.so pppm{{ppp.id}}
{% endif %}
user "{{ppp.username}}"
ifname ppp{{ppp.id}}
+ipv6
variables.yaml
View file @
8f0c125f
...
...
@@ -23,6 +23,7 @@ vars:
links
:
-
bond0
# 上行链路
type
:
static
# dhcp还是static,manual理论上也可以
direct
:
false
# 是否不使用 bridge 直接连。这种情况下那个网卡不能在别处出现。
address
:
10.0.0.1/24
# 首选地址
moreAddresses
:
-
10.0.0.2/24
# 备选地址
...
...
@@ -71,6 +72,7 @@ vars:
username
:
user
# 拨号用户名,密码在pppoeUsers给出
mac
:
null
# 给ISP看的mac地址,null为随机
dhcpv6Client
:
false
# 使用这里的DHCPv6,所有ppp只能有1个
direct
:
false
# 是否不使用 macvlan 直接连。这种情况下同一个链路不能多次使用,且不能使用 mac 属性。
pppoeUsers
:
# PPPoE帐号
-
username
:
user
password
:
pass
...
...
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