Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
77eba22c
Commit
77eba22c
authored
Jun 05, 2022
by
Antoine Kaufmann
Browse files
experiments: support force mac address setting for linux node config
This sets mac address using ip set link mac.
parent
239716a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
experiments/simbricks/nodeconfig.py
experiments/simbricks/nodeconfig.py
+4
-0
No files found.
experiments/simbricks/nodeconfig.py
View file @
77eba22c
...
...
@@ -130,6 +130,7 @@ class LinuxNode(NodeConfig):
def
__init__
(
self
):
self
.
drivers
=
[]
self
.
force_mac_addr
=
None
def
prepare_post_cp
(
self
):
l
=
[]
...
...
@@ -138,6 +139,9 @@ class LinuxNode(NodeConfig):
l
.
append
(
'insmod '
+
d
)
else
:
l
.
append
(
'modprobe '
+
d
)
if
self
.
force_mac_addr
:
l
.
append
(
'ip link set dev '
+
self
.
ifname
+
' address '
+
self
.
force_mac_addr
)
l
.
append
(
'ip link set dev '
+
self
.
ifname
+
' up'
)
l
.
append
(
'ip addr add %s/%d dev %s'
%
(
self
.
ip
,
self
.
prefix
,
self
.
ifname
))
...
...
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