Adding NAT class

Includes automatic NAT feature (mn --nat) and addNAT convenience method for topologies
fixes #111
This commit is contained in:
Brian O'Connor
2013-10-03 09:39:40 -07:00
committed by Brian O'Connor
parent 433d83221a
commit 47b9466fad
4 changed files with 118 additions and 4 deletions
+5
View File
@@ -193,6 +193,9 @@ class MininetRunner( object ):
opts.add_option( '--pin', action='store_true',
default=False, help="pin hosts to CPU cores "
"(requires --host cfs or --host rt)" )
opts.add_option( '--nat', action='store_true',
default=False, help="adds a NAT to the topology "
"that connects Mininet to the physical network" )
opts.add_option( '--version', action='callback', callback=version )
self.options, self.args = opts.parse_args()
@@ -223,6 +226,8 @@ class MininetRunner( object ):
start = time.time()
topo = buildTopo( TOPOS, self.options.topo )
if self.options.nat:
topo.addNAT()
switch = customConstructor( SWITCHES, self.options.switch )
host = customConstructor( HOSTS, self.options.host )
controller = customConstructor( CONTROLLERS, self.options.controller )