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
a802d8b1
Commit
a802d8b1
authored
11 years ago
by
Brian O'Connor
Browse files
Options
Downloads
Patches
Plain Diff
more NAT cleanup of net and topo
parent
555d10de
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mininet/net.py
+0
-21
0 additions, 21 deletions
mininet/net.py
mininet/topo.py
+0
-12
0 additions, 12 deletions
mininet/topo.py
with
0 additions
and
33 deletions
mininet/net.py
+
0
−
21
View file @
a802d8b1
...
...
@@ -181,10 +181,6 @@ def addHost( self, name, cls=None, **params ):
self
.
nextCore
=
(
self
.
nextCore
+
1
)
%
self
.
numCores
self
.
nextIP
+=
1
defaults
.
update
(
params
)
# TODO: clean this up
if
params
.
get
(
'
isNAT
'
,
False
):
print
"
***** &&&&&& !!!! nat nat nat
"
cls
=
NAT
if
not
cls
:
cls
=
self
.
host
h
=
cls
(
name
,
**
defaults
)
...
...
@@ -319,21 +315,6 @@ def configHosts( self ):
host
.
cmd
(
'
ifconfig lo up
'
)
info
(
'
\n
'
)
'''
TODO: remove this!
def configGateway( self ):
"""
Add gateway routes to all hosts if the networks has a gateway.
"""
if self.gateway:
gatewayIP = self.gateway.defaultIntf().IP()
for host in self.hosts:
if host.inNamespace and self.gateway:
host.cmd(
'
ip route flush root 0/0
'
)
host.cmd(
'
route add -net
'
, self.ipBase,
'
dev
'
, host.defaultIntf() )
host.cmd(
'
route add default gw
'
, gatewayIP )
else:
# Don
'
t mess with hosts in the root namespace
pass
'''
def
buildFromTopo
(
self
,
topo
=
None
):
"""
Build mininet from a topology object
At the end of this function, everything should be connected
...
...
@@ -392,8 +373,6 @@ def build( self ):
self
.
startTerms
()
if
self
.
autoStaticArp
:
self
.
staticArp
()
# TODO: remove this
#self.configGateway()
self
.
built
=
True
def
startTerms
(
self
):
...
...
This diff is collapsed.
Click to expand it.
mininet/topo.py
+
0
−
12
View file @
a802d8b1
...
...
@@ -12,7 +12,6 @@
'''
from
mininet.util
import
irange
,
natural
,
naturalSeq
from
mininet.node
import
NAT
class
MultiGraph
(
object
):
"
Utility class to track nodes and edges - replaces networkx.Graph
"
...
...
@@ -90,17 +89,6 @@ def addSwitch(self, name, **opts):
result
=
self
.
addNode
(
name
,
isSwitch
=
True
,
**
opts
)
return
result
def
addNAT
(
self
,
name
=
'
nat
'
,
connect
=
True
,
inNamespace
=
False
,
**
opts
):
"""
Convenience method: Add NAT to graph.
name: NAT name
connect: True will automatically connect to the first switch
"""
#nat = self.addNode(name, isNAT=True, inNamespace=False)
nat
=
self
.
addNode
(
name
,
cls
=
NAT
,
inNamespace
=
inNamespace
,
hosts
=
self
.
hosts
(),
**
opts
)
if
connect
:
# connect the NAT to the first switch
self
.
addLink
(
name
,
self
.
switches
()[
0
])
return
nat
def
addLink
(
self
,
node1
,
node2
,
port1
=
None
,
port2
=
None
,
**
opts
):
"""
node1, node2: nodes to link together
...
...
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