self.host.exec_cmd(cmd) if __name__ == '__main__': ipmininet.DEBUG_FLAG = True lg.setLogLevel("info") # Start network net = IPNet(topo=SimpleTopo(), use_v4=True, allocate_IPs=False) try: net.start() # Execute Commands # Enable SRv6 On Routers. r1 = RouterConfiguration(net.get('r1'),1,r1_routes) r2 = RouterConfiguration(net.get('r2'),2,r2_routes) r3 = RouterConfiguration(net.get('r3'),3,r3_routes) r4 = RouterConfiguration(net.get('r4'),4,r4_routes,False) ids = RouterConfiguration(net.get('ids'),5,ids_routes) HostConfiguration(net.get('a'),'a',1) HostConfiguration(net.get('b'),'b',4) HostConfiguration(net.get('c'),'c',3) # RouterConfiguration.build_dx4_tunnel(r1,r3,"a") # RouterConfiguration.build_dx4_tunnel(r3,r4,"b") # RouterConfiguration.build_dx4_tunnel(r1,r4,"c") # RouterConfiguration.build_dx6_tunnel(r1,r3,"a1")
self.host.exec_cmd(cmd) if __name__ == '__main__': ipmininet.DEBUG_FLAG = True lg.setLogLevel("info") # Start network net = IPNet(topo=SimpleTopo(), use_v4=True, allocate_IPs=False) try: net.start() # Execute Commands # Enable SRv6 On Routers. r1 = RouterConfiguration(net.get('r1'), 1) r2 = RouterConfiguration(net.get('r2'), 2) r3 = RouterConfiguration(net.get('r3'), 3) r4 = RouterConfiguration(net.get('r4'), 4) fw = RouterConfiguration(net.get('fw'), 5) HostConfiguration(net.get('a'), 'a', 1) HostConfiguration(net.get('b'), 'b', 4) HostConfiguration(net.get('c'), 'c', 3) # RouterConfiguration.build_dx4_tunnel(r1,r3,"a") # RouterConfiguration.build_dx4_tunnel(r3,r4,"b") # RouterConfiguration.build_dx4_tunnel(r1,r4,"c") # RouterConfiguration.build_dx6_tunnel(r1,r3,"a1") # RouterConfiguration.build_dx6_tunnel(r3,r4,"b1")
self.host.exec_cmd(cmd) if __name__ == '__main__': ipmininet.DEBUG_FLAG = True lg.setLogLevel("info") # Start network net = IPNet(topo=SimpleTopo(), use_v4=True, allocate_IPs=False) try: net.start() # Execute Commands # Enable SRv6 On Routers. r1 = RouterConfiguration(net.get('r1'), 1, r1_routes) r2 = RouterConfiguration(net.get('r2'), 2, r2_routes, False) r3 = RouterConfiguration(net.get('r3'), 3, r3_routes) r4 = RouterConfiguration(net.get('r4'), 4, r4_routes) HostConfiguration(net.get('a'), 'a', 1) HostConfiguration(net.get('b'), 'b', 4) HostConfiguration(net.get('c'), 'c', 3) # RouterConfiguration.build_dx4_tunnel(r1,r3,"a") # RouterConfiguration.build_dx4_tunnel(r3,r4,"b") # RouterConfiguration.build_dx4_tunnel(r1,r4,"c") # RouterConfiguration.build_dx6_tunnel(r1,r3,"a1") # RouterConfiguration.build_dx6_tunnel(r3,r4,"b1") # RouterConfiguration.build_dx6_tunnel(r1,r4,"c1")
self.host.exec_cmd(cmd) if __name__ == '__main__': ipmininet.DEBUG_FLAG = True lg.setLogLevel("info") # Start network net = IPNet(topo=SimpleTopo(), use_v4=True, allocate_IPs=False) try: net.start() # Execute Commands # Enable SRv6 On Routers. r1 = RouterConfiguration(net.get('r1'),1) r2 = RouterConfiguration(net.get('r2'),2) r3 = RouterConfiguration(net.get('r3'),3) r4 = RouterConfiguration(net.get('r4'),4) fw = RouterConfiguration(net.get('fw'),5) HostConfiguration(net.get('a'),'a',1) HostConfiguration(net.get('b'),'b',4) HostConfiguration(net.get('c'),'c',3) # RouterConfiguration.build_dx4_tunnel(r1,r3,"a") # RouterConfiguration.build_dx4_tunnel(r3,r4,"b") # RouterConfiguration.build_dx4_tunnel(r1,r4,"c") # RouterConfiguration.build_dx6_tunnel(r1,r3,"a1")
self.addLinks((as1_r1, serv1), (as1_r2, serv2)) self.addLink(as1_r1, master) self.addLink(as1_rr, as1_r1, igp_metric=2) self.addLinks((as1_rr, as1_r2), (as1_rr, as2_r1)) self.addLinks((as1_r1, as1_h1), (as1_rr, as1_h2), (as2_r1, as2_h)) set_rr(self, rr=as1_rr, peers=[as1_r1, as1_r2]) ebgp_session(self, as1_rr, as2_r1, link_type=SHARE) super().build(*args, **kwargs) if __name__ == '__main__': # allocate_IPS = False to disable IP auto-allocation net = IPNet(topo=AnycastTopo()) #print(type(net.get('as2_h'))) s1 = net.get('s1') s2 = net.get('s2') #print(type(h)) #print(help(h.setIP)) #print(help(h)) try: net.start() IPCLI(net) finally: net.stop()
self.addLink(as1_rr, as1_r1, igp_metric = 2) self.addLinks((as1_rr, as1_r2), (as1_rr, as2_r1)) self.addLinks((as1_r1, as1_h1), (as1_rr, as1_h2), (as2_r1, as2_h)) set_rr(self, rr = as1_rr, peers = [as1_r1, as1_r2]) set_rr(self, rr = as1_r1, peers = [serv1]) set_rr(self, rr = as1_r2, peers = [serv2]) ebgp_session(self, as1_rr, as2_r1, link_type=None) super().build(*args, **kwargs) if __name__ == '__main__': # allocate_IPS = False to disable IP auto-allocation net = IPNet(topo=SecurityTopo()) #print(type(net.get('as2_h'))) #s1 = net.get('s1') #s2 = net.get('s2') #print(type(h)) #print(help(h.setIP)) #print(help(h)) net.get('as1_rr').cmd('sudo sysctl net.ipv4.ip_default_ttl=255') net.get('as2_r1').cmd('sudo sysctl net.ipv4.ip_default_ttl=255') try: net.start() IPCLI(net) finally: net.stop()
self.host.exec_cmd(cmd) if __name__ == '__main__': ipmininet.DEBUG_FLAG = True lg.setLogLevel("info") # Start network net = IPNet(topo=SimpleTopo(), use_v4=True, allocate_IPs=False) try: net.start() # Execute Commands # Enable SRv6 On Routers. r1 = RouterConfiguration(net.get('r1'),1) r3 = RouterConfiguration(net.get('r3'),3) r4 = RouterConfiguration(net.get('r4'),4) HostConfiguration(net.get('a'),'a',1) HostConfiguration(net.get('b'),'b',4) HostConfiguration(net.get('c'),'c',3) # RouterConfiguration.build_dx4_tunnel(r1,r3,"a") # RouterConfiguration.build_dx4_tunnel(r3,r4,"b") # RouterConfiguration.build_dx4_tunnel(r1,r4,"c") # RouterConfiguration.build_dx6_tunnel(r1,r3,"a1") # RouterConfiguration.build_dx6_tunnel(r3,r4,"b1") # RouterConfiguration.build_dx6_tunnel(r1,r4,"c1")