title: Mininet : How to make communicating two host between two switches
body: <p>I'm making a simple script in python working with mininet.
  I want to make communicating two hosts (say h1 and h2) separated by two switches(say s1 and s2).
  When h1 try to ping h2 ,the ARP resolution request for h2 IP address crosses the link between the two switches but doesn't reach the other host.</p>
  
  <p>This is the topology:</p>
  
  <p>H1  ------------- S1 ------------- S2 ------------ H2</p>
  
  <p>Ip H1 10.10.0.1/24<br>
  Mac H1 00:00:00:10:00:01<br>
  Ip H2 10.10.0.2/24<br>
  Mac H2 00:00:00:10:00:02                        </p>
  
  <pre><code>def networkTest():
  
      net = Mininet( topo=None,
                 build=False )
  
  
      s1 = net.addHost('s1', cls=Node)
      s2 = net.addHost('s2', cls=Node)
  
      h1 = net.addHost('h1', cls=Host, mac='00:00:10:10:00:01')
      h2 = net.addHost('h2', cls=Host, mac='00:00:10:10:00:02')
  
      Link(s1, h1, intfName1='s1-eth0')
      Link(s2, h2, intfName1='s2-eth0')
      Link(s1, s2, intfName1='s1-eth1')
  
      net.build()
  
      for controller in net.controllers:
          controller.start()
  
      h1.cmd('ip addr add 10.10.0.1/24 dev h1-eth0')
      h1.cmd('ip link set h1-eth0 up')
  
      h2.cmd('ip addr add 10.10.0.2/24 dev h2-eth0')
      h2.cmd('ip link set h2-eth0 up')
  
      s1.cmd('brctl addbr br0')
      s1.cmd('brctl addif br0 s1-eth0')
      s1.cmd('brctl addif br0 s1-eth1')
      s1.cmd('ip link set br0 up')
  
      s2.cmd('brctl addbr br1')
      s2.cmd('brctl addif br1 s2-eth0')
      s2.cmd('ip link set br1 up')
  
      CLI(net)
      net.stop()
  </code></pre>
  
  <p>Inside mininet CLI i open an xterm on h1 and try to ping h2 </p>
  
  <pre><code>ping 10.10.0.2
  </code></pre>
  
  <p>but the answer is </p>
  
  <pre><code>From 10.10.0.1 icmp_seq = 1 Destination Host Unreachable
  </code></pre>