Revision 79f5d39d

View differences:

examples/linuxrouter.py
20 20
    r0-eth3 - s3-eth1 - h3-eth0 (IP: 10.0.0.100)
21 21

  
22 22
The example relies on default routing entries that are
23
automatically created for each interface. Additional
24
routes may be added to the router or hosts by executing
25
'ip route' or 'route' commands on the router or hosts.
23
automatically created for each router interface, as well
24
as 'defaultRoute' parameters for the host interfaces.
25

  
26
Additional routes may be added to the router or hosts by
27
executing 'ip route' or 'route' commands on the router or hosts.
26 28
"""
27 29

  
28 30
from mininet.topo import Topo
......
49 51

  
50 52
    def build( self, **_opts ):
51 53

  
52
        defaultIP='192.168.1.1/24'  # IP address for r0-eth1
54
        defaultIP = '192.168.1.1/24'  # IP address for r0-eth1
53 55
        router = self.addNode( 'r0', cls=LinuxRouter, ip=defaultIP )
54 56

  
55 57
        s1, s2, s3 = [ self.addSwitch( s ) for s in 's1', 's2', 's3' ]
......
68 70
        h3 = self.addHost( 'h3', ip='10.0.0.100/8',
69 71
                           defaultRoute='via 10.0.0.1' )
70 72

  
71
        for h, s in [ (h1,s1), (h2,s2), (h3,s3) ]:
73
        for h, s in [ (h1, s1), (h2, s2), (h3, s3) ]:
72 74
            self.addLink( h, s )
73 75

  
74 76

  

Also available in: Unified diff