# HG changeset patch # User igor # Date 1192199494 -10800 # Node ID 10444acb35f4fec328f6d45e30e24f2bbad85296 # Parent 54b7c7ae50ec5edbb011f960e0f3723b73c2fbc4 *** empty log message *** diff -r 54b7c7ae50ec -r 10444acb35f4 build-xenomips-image --- a/build-xenomips-image Fri Sep 28 13:35:54 2007 +0300 +++ b/build-xenomips-image Fri Oct 12 17:31:34 2007 +0300 @@ -1,13 +1,13 @@ #!/bin/sh DYNAMIPS_BUILD=no -XENOMIPS_FS_BUILD=no +XENOMIPS_FS_BUILD=yes CONFIG_FS_BUILD=no IOS_FS_BUILD=yes XENOMIPS_DIR="files/" -XENOMIPS_IMAGES_DIR="/home/nata/xenomips-images/" -IOS_DIR="/home/nata/ios/" +XENOMIPS_IMAGES_DIR="/xen/images/" +IOS_DIR="ios/" SSH_OPEN_KEY=files/id_dsa.pub #Xenomips FS @@ -23,7 +23,7 @@ IOS_FS_SIZE=2048k IOS_FS_NAME=${XENOMIPS_IMAGES_DIR}/xenomips-ios1.img -DEBIAN_MIRROR=http://debian.org.ua/debian +DEBIAN_MIRROR=http://debian.osdn.org.ua/debian DISTRO=sid PACKAGES="openssh-server libc6-xen libelf1 libpcap0.8 screen nfs-common quagga tcpdump" DYNAMIPS_SOURCES=http://www.ipflow.utc.fr/dynamips/dynamips-0.2.7.tar.gz @@ -83,6 +83,10 @@ FSTAB mkdir -p /data/Cisco_IOS /xenomips +cat < /etc/sysctl.conf +net/ipv4/ip_forward=1 +EOF + cat <<'INTERFACES' > /etc/network/interfaces auto lo eth0 diff -r 54b7c7ae50ec -r 10444acb35f4 xendomain.py --- a/xendomain.py Fri Sep 28 13:35:54 2007 +0300 +++ b/xendomain.py Fri Oct 12 17:31:34 2007 +0300 @@ -29,8 +29,8 @@ pae=1 if pae: - kernel = "/boot/vmlinuz-2.6.18-5-xen-686" - ramdisk = "/boot/initrd.img-2.6.18-5-xen-686" + kernel = "/boot/vmlinuz-2.6.18-4-xen-686" + ramdisk = "/boot/initrd.img-2.6.18-4-xen-686" else: kernel = "/boot/vmlinuz-2.6.18-without-PAE-4-xen-686" ramdisk = "/boot/initrd.img-2.6.18-without-PAE-4-xen-686-domU" diff -r 54b7c7ae50ec -r 10444acb35f4 xentaur.py --- a/xentaur.py Fri Sep 28 13:35:54 2007 +0300 +++ b/xentaur.py Fri Oct 12 17:31:34 2007 +0300 @@ -8,8 +8,8 @@ sys.path.append('/etc/xen') sys.path.append(xentaur_path) -network='netw' -domain='dyn3' +network='snrs_ipsec_preshared_1' +domain='qua1' from xendomain import * bridges_turned_down=[] @@ -38,7 +38,7 @@ def create_bridges_script(): unbound_bridges=set(bridges)-set(real_bridges) - create_unbound_bridges="\n".join(map(lambda x: "sudo /usr/sbin/brctl show | awk '{print $1}' | grep -q "+x+" || sudo /usr/sbin/brctl addbr "+x, unbound_bridges)) + create_unbound_bridges="\n".join(map(lambda x: "sudo /usr/sbin/brctl show | awk '{print $1}' | grep -qx "+x+" || sudo /usr/sbin/brctl addbr "+x, unbound_bridges)) create_unbound_bridges+="\n"+"\n".join(map(lambda x: "sudo /bin/ip link set "+x+" up", unbound_bridges)) print """#!/bin/sh @@ -185,6 +185,7 @@ """ % graph_dot) f.close() run_command("neato -Tpng -o xenomips.png xenomips.dot ") + run_command("neato -Tsvg -o xenomips.svg xenomips.dot ") def autoredraw(): graph() @@ -386,9 +387,85 @@ def configure_ip_addresses(doms=domains): + + cisco_set_ip_on_int=""" +\n\n\n +int fa%s/0 +no ip address +ip address %s 255.255.255.0 +no shutdown +exit +""" + + quagga_set_ip_on_int=""" +int eth%s +no ip address +ip address %s/24 +no shutdown +exit +""" + + for dom in doms: + i=domains.index(dom)+1 + if domain_types[domains.index(dom)] == 'quagga': + command = quagga_set_ip_on_int + write_to(i,"\nconf t\n") + j=0 + for br in vbridges_table[dom]: + write_to(i,command % (j, "192.168.%s.%s"%(bridges.index(br)+1,i))) + j+=1 + write_to(i,"\nend\n") + else: + command = cisco_set_ip_on_int + write_to(i,"\nena\nconf t\n") + j=0 + for br in vbridges_table[dom]: + write_to(i,command % (j, "192.168.%s.%s"%(bridges.index(br)+1,i))) + j+=1 + write_to(i,"\nend\n") + return 0 + +def configure_no_ip_addresses(doms=domains): + + cisco_set_ip_on_int=""" +\n\n\n +int fa%s/0 +no ip address %s 255.255.255.0 +exit +""" + + quagga_set_ip_on_int=""" +int eth%s +no ip address %s/24 +exit +""" + + for dom in doms: + i=domains.index(dom)+1 + if domain_types[domains.index(dom)] == 'quagga': + command = quagga_set_ip_on_int + write_to(i,"\nconf t\n") + j=0 + for br in vbridges_table[dom]: + write_to(i,command % (j, "192.168.%s.%s"%(bridges.index(br)+1,i))) + j+=1 + write_to(i,"\nend\n") + else: + command = cisco_set_ip_on_int + write_to(i,"\nena\nconf t\n") + j=0 + for br in vbridges_table[dom]: + write_to(i,command % (j, "192.168.%s.%s"%(bridges.index(br)+1,i))) + j+=1 + write_to(i,"\nend\n") return 0 def configure_ospf(doms=domains): + for dom in doms: + if domain_types[domains.index(dom)] == 'quagga': + write_to(dom,"\n\nconf t\nrouter ospf\nnetwork 192.168.0.0/16 area 0\nend\n") + else: + write_to(dom,"\n\nena\nconf t\nrouter ospf 1\nnetwork 192.168.0.0 0.0.255.255 area 0\nend\n") return 0 def configure_save(doms=domains):