Update and rename MantenerFIFO to MantenerFIFO.md
[vsorcdistro/.git] / mininet / examples / nat.py
1 #!/usr/bin/python
2
3 """
4 Example to create a Mininet topology and connect it to the internet via NAT
5 """
6
7
8 from mininet.cli import CLI
9 from mininet.log import lg, info
10 from mininet.topolib import TreeNet
11
12
13 if __name__ == '__main__':
14     lg.setLogLevel( 'info')
15     net = TreeNet( depth=1, fanout=4 )
16     # Add NAT connectivity
17     net.addNAT().configDefault()
18     net.start()
19     info( "*** Hosts are running and should have internet connectivity\n" )
20     info( "*** Type 'exit' or control-D to shut down network\n" )
21     CLI( net )
22     # Shut down NAT
23     net.stop()