1 """Topology description for configuring vpnservice for hosts on 2 switches
4 ------------- gre -------------
5 | h1-----s1 |------------| s2------h3|
9 ------------- -------------
10 1)The topology consits of switch s1 in one VM connected to hosts h1,h2.Switch s2 in another VM connected to hosts h3,h4.
11 2)GRE tunnel is configured between s1 and s2 using ovs-vsctl commands.
12 3)h1 and h3 will be configured for vpn instance testVpn1 and h2,h4 for testVpn2.
15 from mininet.topo import Topo
19 """Single switch s1 connected to n=2 hosts."""
23 switch = self.addSwitch('s1')
26 host = self.addHost('h%s' % (h + 1), mac="00:00:00:00:00:0" + str(h + 1), ip="10.0.0." + str(h + 1))
27 self.addLink(host, switch)
31 """Single switch s2 connected to n=2 hosts."""
35 switch = self.addSwitch('s2')
38 host = self.addHost('h%s' % (h + 3), mac="00:00:00:00:00:0" + str(h + 3), ip="10.0.0." + str(h + 3))
39 self.addLink(host, switch)
42 topos = {'Switch1': (lambda: Switch1()),
43 'Switch2': (lambda: Switch2())}