Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mininet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Olaf Bergmann
mininet
Commits
a16fae67
Commit
a16fae67
authored
15 years ago
by
Bob Lantz
Browse files
Options
Downloads
Patches
Plain Diff
Tweaks to separate command and options.
parent
91b9e374
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/sshd.py
+2
-2
2 additions, 2 deletions
examples/sshd.py
with
2 additions
and
2 deletions
examples/sshd.py
+
2
−
2
View file @
a16fae67
...
...
@@ -47,13 +47,13 @@ def connectToRootNS( network, switch, ip, prefixLen, routes ):
for
net
in
routes
:
root
.
cmd
(
'
route add -net
'
+
net
+
'
dev
'
+
intf
)
def
sshd
(
network
,
cmd
=
'
/usr/sbin/sshd
-D
'
):
def
sshd
(
network
,
cmd
=
'
/usr/sbin/sshd
'
,
opts
=
'
-D
'
):
"
Start a network, connect it to root ns, and run sshd on all hosts.
"
switch
=
network
.
switches
[
0
]
# switch to use
ip
=
'
10.123.123.1
'
# our IP address on host network
routes
=
[
'
10.0.0.0/8
'
]
# host networks to route to
connectToRootNS
(
network
,
switch
,
ip
,
8
,
routes
)
for
host
in
network
.
hosts
:
host
.
cmd
(
cmd
+
'
&
'
)
for
host
in
network
.
hosts
:
host
.
cmd
(
cmd
+
'
'
+
opts
+
'
&
'
)
print
print
"
*** Hosts are running sshd at the following addresses:
"
print
...
...
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