Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
UserConfig
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jiří Kalvoda
UserConfig
Commits
c7cf8b3e
Commit
c7cf8b3e
authored
1 year ago
by
Jiří Kalvoda
Browse files
Options
Downloads
Patches
Plain Diff
NET namespaces
parent
4147ab0a
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
network/init.sh
+2
-0
2 additions, 0 deletions
network/init.sh
network/namespaces
+34
-0
34 additions, 0 deletions
network/namespaces
with
36 additions
and
0 deletions
network/init.sh
+
2
−
0
View file @
c7cf8b3e
...
...
@@ -44,4 +44,6 @@ confln cdwifi-autologin.service /lib/systemd/system/ cr
confln blatto-daemon.py /usr/bin/net-blatto-daemon c
init-service net-blatto-daemon root /usr/bin/net-blatto-daemon
""
"ExecReload=/bin/kill -HUP
\$
MAINPID"
confln namespaces /etc/net/ cr
install_ok
This diff is collapsed.
Click to expand it.
network/namespaces
0 → 100755
+
34
−
0
View file @
c7cf8b3e
#!/bin/sh
set
-o
xtrace
ipv4_prefix
=
10.39
add_netns
()
{
name
=
$1
ipv4_subnet
=
$2
route_rule
=
$3
ip netns add
$name
ip
link
add ve2
$name
type
veth peer name vp2
${
name
}
ip
link set
vp2
${
name
}
netns
$name
ip addr add
$ipv4_prefix
.
$ipv4_subnet
.1/24 dev ve2
$name
ip route add
$ipv4_prefix
.
$ipv4_subnet
.0/24 dev ve2
$name
table 39
ip
-n
$name
addr add
$ipv4_prefix
.
$ipv4_subnet
.10/24 dev vp2
${
name
}
ip
link set
ve2
$name
up
ip
-n
$name
link set
vp2
${
name
}
up
ip netns
exec
$name
ip
link set
dev lo up
ip netns
exec
$name
ip route add default via
$ipv4_prefix
.
$ipv4_subnet
.1
ip-man replace_rule
--iif
ve2
$name
--priority_base
100
$route_rule
}
add_netns 2direct 0 254
add_netns 2bl-mn 2 122
add_netns 2bl-awn 3 123
add_netns 2bl-mul 4 124
add_netns 2untr 6 6
add_netns 2untr-bl 61 6121
add_netns 2untr-bl-mn 62 6122
add_netns 2untr-bl-awn 63 6123
add_netns 2untr-bl-mul 64 6124
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment