node n1 { type router model router network-config { hostname n2001 ! interface eth2 ip address 12.0.0.1/24 ! interface eth1 ip address 30.0.0.1/24 ! interface eth0 ip address 10.0.0.1/8 ! } canvas c1 iconcoords {414.0 147.0} labelcoords {414.0 191.0} interface-peer {eth0 n2} interface-peer {eth1 n3} interface-peer {eth2 n6} custom-config { custom-config-id service:zebra custom-command zebra config { ('/usr/local/etc/quagga', '/var/run/quagga', ) ('/usr/local/etc/quagga/Quagga.conf', 'quaggaboot.sh', ) 35 ('sh quaggaboot.sh zebra', ) ('killall zebra', ) } } custom-config { custom-config-id service:zebra:quaggaboot.sh custom-command quaggaboot.sh config { #!/bin/sh # auto-generated by zebra service (quagga.py) QUAGGA_CONF=/usr/local/etc/quagga/Quagga.conf QUAGGA_SBIN_SEARCH="/usr/local/sbin /usr/sbin /usr/lib/quagga" QUAGGA_BIN_SEARCH="/usr/local/bin /usr/bin /usr/lib/quagga" QUAGGA_STATE_DIR=/var/run/quagga QUAGGA_USER=root QUAGGA_GROUP=root searchforprog() { prog=$1 searchpath=$@ ret= for p in $searchpath; do if [ -x $p/$prog ]; then ret=$p break fi done echo $ret } confcheck() { CONF_DIR=`dirname $QUAGGA_CONF` # if /etc/quagga exists, point /etc/quagga/Quagga.conf -> CONF_DIR if [ "$CONF_DIR" != "/etc/quagga" ] && [ -d /etc/quagga ] && [ ! -e /etc/quagga/Quagga.conf ]; then ln -s $CONF_DIR/Quagga.conf /etc/quagga/Quagga.conf fi } bootdaemon() { QUAGGA_SBIN_DIR=$(searchforprog $1 $QUAGGA_SBIN_SEARCH) if [ "z$QUAGGA_SBIN_DIR" = "z" ]; then echo "ERROR: Quagga's '$1' daemon not found in search path:" echo " $QUAGGA_SBIN_SEARCH" return 1 fi $QUAGGA_SBIN_DIR/$1 -u $QUAGGA_USER -g $QUAGGA_GROUP -d } bootvtysh() { QUAGGA_BIN_DIR=$(searchforprog $1 $QUAGGA_BIN_SEARCH) if [ "z$QUAGGA_BIN_DIR" = "z" ]; then echo "ERROR: Quagga's '$1' daemon not found in search path:" echo " $QUAGGA_SBIN_SEARCH" return 1 fi vtyfiles="zebra.vty" for r in rip ripng ospf6 ospf bgp; do if grep -q "^router \<${r}\>" $QUAGGA_CONF; then vtyfiles="$vtyfiles ${r}d.vty" fi done # wait for Quagga daemon vty files to appear before invoking vtysh for f in $vtyfiles; do count=1 until [ -e $QUAGGA_STATE_DIR/$f ]; do if [ $count -eq 10 ]; then echo "ERROR: vty file not found: $QUAGGA_STATE_DIR/$f" >&2 return 1 fi sleep 0.1 count=$(($count + 1)) done done $QUAGGA_BIN_DIR/vtysh -b } confcheck if [ "x$1" = "x" ]; then echo "ERROR: missing the name of the Quagga daemon to boot" exit 1 elif [ "$1" = "vtysh" ]; then bootvtysh $1 else bootdaemon $1 fi } } custom-config { custom-config-id service:zebra:/usr/local/etc/quagga/Quagga.conf custom-command /usr/local/etc/quagga/Quagga.conf config { interface eth0 ip address 10.0.0.1/8 ! interface eth1 ip address 30.0.0.1/24 ! interface eth2 ip address 12.0.0.1/24 ! router rip network 0.0.0.0/0 ! password 123456 enable password 123456 } } services {zebra RIP vtysh IPForward} } node n2 { type router model router network-config { hostname n2003 ! interface eth0 ip address 10.0.0.2/8 ! interface eth2 ip address 70.0.0.1/24 ! interface eth1 ip address 20.0.0.1/24 ! } canvas c1 iconcoords {175.0 366.0} labelcoords {195.0 396.0} interface-peer {eth0 n1} interface-peer {eth1 n3} interface-peer {eth2 n4} custom-config { custom-config-id service:zebra custom-command zebra config { ('/usr/local/etc/quagga', '/var/run/quagga', ) ('/usr/local/etc/quagga/Quagga.conf', 'quaggaboot.sh', ) 35 ('sh quaggaboot.sh zebra', ) ('killall zebra', ) } } custom-config { custom-config-id service:zebra:quaggaboot.sh custom-command quaggaboot.sh config { #!/bin/sh # auto-generated by zebra service (quagga.py) QUAGGA_CONF=/usr/local/etc/quagga/Quagga.conf QUAGGA_SBIN_SEARCH="/usr/local/sbin /usr/sbin /usr/lib/quagga" QUAGGA_BIN_SEARCH="/usr/local/bin /usr/bin /usr/lib/quagga" QUAGGA_STATE_DIR=/var/run/quagga QUAGGA_USER=root QUAGGA_GROUP=root searchforprog() { prog=$1 searchpath=$@ ret= for p in $searchpath; do if [ -x $p/$prog ]; then ret=$p break fi done echo $ret } confcheck() { CONF_DIR=`dirname $QUAGGA_CONF` # if /etc/quagga exists, point /etc/quagga/Quagga.conf -> CONF_DIR if [ "$CONF_DIR" != "/etc/quagga" ] && [ -d /etc/quagga ] && [ ! -e /etc/quagga/Quagga.conf ]; then ln -s $CONF_DIR/Quagga.conf /etc/quagga/Quagga.conf fi } bootdaemon() { QUAGGA_SBIN_DIR=$(searchforprog $1 $QUAGGA_SBIN_SEARCH) if [ "z$QUAGGA_SBIN_DIR" = "z" ]; then echo "ERROR: Quagga's '$1' daemon not found in search path:" echo " $QUAGGA_SBIN_SEARCH" return 1 fi $QUAGGA_SBIN_DIR/$1 -u $QUAGGA_USER -g $QUAGGA_GROUP -d } bootvtysh() { QUAGGA_BIN_DIR=$(searchforprog $1 $QUAGGA_BIN_SEARCH) if [ "z$QUAGGA_BIN_DIR" = "z" ]; then echo "ERROR: Quagga's '$1' daemon not found in search path:" echo " $QUAGGA_SBIN_SEARCH" return 1 fi vtyfiles="zebra.vty" for r in rip ripng ospf6 ospf bgp; do if grep -q "^router \<${r}\>" $QUAGGA_CONF; then vtyfiles="$vtyfiles ${r}d.vty" fi done # wait for Quagga daemon vty files to appear before invoking vtysh for f in $vtyfiles; do count=1 until [ -e $QUAGGA_STATE_DIR/$f ]; do if [ $count -eq 10 ]; then echo "ERROR: vty file not found: $QUAGGA_STATE_DIR/$f" >&2 return 1 fi sleep 0.1 count=$(($count + 1)) done done $QUAGGA_BIN_DIR/vtysh -b } confcheck if [ "x$1" = "x" ]; then echo "ERROR: missing the name of the Quagga daemon to boot" exit 1 elif [ "$1" = "vtysh" ]; then bootvtysh $1 else bootdaemon $1 fi } } custom-config { custom-config-id service:zebra:/usr/local/etc/quagga/Quagga.conf custom-command /usr/local/etc/quagga/Quagga.conf config { interface eth0 ip address 10.0.0.2/8 ! interface eth1 ip address 20.0.0.1/24 ! interface eth2 ip address 70.0.0.1/24 ! router rip network 0.0.0.0/0 ! password 123456 enable password 123456 } } services {zebra RIP vtysh IPForward} } node n3 { type router model router network-config { hostname n2002 ! interface eth2 ip address 192.168.0.1/30 ! interface eth1 ip address 30.0.0.2/24 ! interface eth0 ip address 20.0.0.2/24 ! } canvas c1 iconcoords {674.0 365.0} labelcoords {662.0 397.0} interface-peer {eth0 n2} interface-peer {eth1 n1} interface-peer {eth2 n5} custom-config { custom-config-id service:zebra custom-command zebra config { ('/usr/local/etc/quagga', '/var/run/quagga', ) ('/usr/local/etc/quagga/Quagga.conf', 'quaggaboot.sh', ) 35 ('sh quaggaboot.sh zebra', ) ('killall zebra', ) } } custom-config { custom-config-id service:zebra:quaggaboot.sh custom-command quaggaboot.sh config { #!/bin/sh # auto-generated by zebra service (quagga.py) QUAGGA_CONF=/usr/local/etc/quagga/Quagga.conf QUAGGA_SBIN_SEARCH="/usr/local/sbin /usr/sbin /usr/lib/quagga" QUAGGA_BIN_SEARCH="/usr/local/bin /usr/bin /usr/lib/quagga" QUAGGA_STATE_DIR=/var/run/quagga QUAGGA_USER=root QUAGGA_GROUP=root searchforprog() { prog=$1 searchpath=$@ ret= for p in $searchpath; do if [ -x $p/$prog ]; then ret=$p break fi done echo $ret } confcheck() { CONF_DIR=`dirname $QUAGGA_CONF` # if /etc/quagga exists, point /etc/quagga/Quagga.conf -> CONF_DIR if [ "$CONF_DIR" != "/etc/quagga" ] && [ -d /etc/quagga ] && [ ! -e /etc/quagga/Quagga.conf ]; then ln -s $CONF_DIR/Quagga.conf /etc/quagga/Quagga.conf fi } bootdaemon() { QUAGGA_SBIN_DIR=$(searchforprog $1 $QUAGGA_SBIN_SEARCH) if [ "z$QUAGGA_SBIN_DIR" = "z" ]; then echo "ERROR: Quagga's '$1' daemon not found in search path:" echo " $QUAGGA_SBIN_SEARCH" return 1 fi $QUAGGA_SBIN_DIR/$1 -u $QUAGGA_USER -g $QUAGGA_GROUP -d } bootvtysh() { QUAGGA_BIN_DIR=$(searchforprog $1 $QUAGGA_BIN_SEARCH) if [ "z$QUAGGA_BIN_DIR" = "z" ]; then echo "ERROR: Quagga's '$1' daemon not found in search path:" echo " $QUAGGA_SBIN_SEARCH" return 1 fi vtyfiles="zebra.vty" for r in rip ripng ospf6 ospf bgp; do if grep -q "^router \<${r}\>" $QUAGGA_CONF; then vtyfiles="$vtyfiles ${r}d.vty" fi done # wait for Quagga daemon vty files to appear before invoking vtysh for f in $vtyfiles; do count=1 until [ -e $QUAGGA_STATE_DIR/$f ]; do if [ $count -eq 10 ]; then echo "ERROR: vty file not found: $QUAGGA_STATE_DIR/$f" >&2 return 1 fi sleep 0.1 count=$(($count + 1)) done done $QUAGGA_BIN_DIR/vtysh -b } confcheck if [ "x$1" = "x" ]; then echo "ERROR: missing the name of the Quagga daemon to boot" exit 1 elif [ "$1" = "vtysh" ]; then bootvtysh $1 else bootdaemon $1 fi } } custom-config { custom-config-id service:zebra:/usr/local/etc/quagga/Quagga.conf custom-command /usr/local/etc/quagga/Quagga.conf config { interface eth0 ip address 20.0.0.2/24 ! interface eth1 ip address 30.0.0.2/24 ! interface eth2 ! router rip network 0.0.0.0/0 ! password 123456 enable password 123456 } } services {zebra RIP vtysh IPForward} } node n4 { type lanswitch network-config { hostname sw2 ! } canvas c1 iconcoords {90.0 427.0} labelcoords {90.0 451.0} interface-peer {e0 n2} interface-peer {e1 n7} } node n5 { type lanswitch network-config { hostname sw3 ! } canvas c1 iconcoords {788.0 446.0} labelcoords {788.0 472.0} interface-peer {e0 n3} interface-peer {e1 n9} } node n6 { type lanswitch network-config { hostname sw1 ! } canvas c1 iconcoords {414.0 67.0} labelcoords {414.0 91.0} interface-peer {e0 n1} interface-peer {e1 n8} } node n7 { type router model PC network-config { hostname n7 ! interface eth0 ip address 70.0.0.20/24 ! } canvas c1 iconcoords {176.0 475.0} labelcoords {176.0 507.0} interface-peer {eth0 n4} } node n8 { type router model PC network-config { hostname n8 ! interface eth0 ip address 12.0.0.20/24 ! } canvas c1 iconcoords {552.0 65.0} labelcoords {552.0 97.0} interface-peer {eth0 n6} } node n9 { type router model router network-config { hostname n2004 ! interface eth1 ip address 50.0.0.1/26 ! interface eth0 ip address 192.168.0.2/30 ! } canvas c1 iconcoords {880.0 360.0} labelcoords {880.0 392.0} services {zebra vtysh IPForward DefaultRoute} interface-peer {eth0 n5} interface-peer {eth1 n10} custom-config { custom-config-id service:zebra custom-command zebra config { files=('/usr/local/etc/quagga/Quagga.conf', 'quaggaboot.sh', '/usr/local/etc/quagga/vtysh.conf', ) } } custom-config { custom-config-id service:zebra:/usr/local/etc/quagga/Quagga.conf custom-command /usr/local/etc/quagga/Quagga.conf config { interface eth0 ! interface eth1 ! ip route 0.0.0.0 0.0.0.0 192.168.0.1 } } custom-config { custom-config-id service:DefaultRoute custom-command DefaultRoute config { files=('defaultroute.sh', ) } } custom-config { custom-config-id service:DefaultRoute:defaultroute.sh custom-command defaultroute.sh config { #!/bin/sh # auto-generated by DefaultRoute service (utility.py) #ip route add default via 192.168.0.1 } } } node n10 { type hub network-config { hostname n10 ! } canvas c1 iconcoords {880.0 232.0} labelcoords {880.0 256.0} interface-peer {e0 n9} } link l1 { delay 80000 nodes {n1 n2} bandwidth 64000 } link l2 { width 2 color Black nodes {n2 n3} bandwidth 0 } link l3 { color Black nodes {n1 n3} bandwidth 0 } link l4 { nodes {n2 n4} bandwidth 0 } link l5 { nodes {n1 n6} bandwidth 0 } link l6 { nodes {n3 n5} bandwidth 0 } link l7 { nodes {n4 n7} bandwidth 0 } link l8 { nodes {n6 n8} bandwidth 0 } link l9 { nodes {n5 n9} bandwidth 0 } link l10 { nodes {n10 n9} bandwidth 0 } canvas c1 { name {Canvas1} } option global { interface_names yes ip_addresses yes ipv6_addresses yes node_labels yes link_labels yes show_api no background_images no annotations yes grid no traffic_start 0 } option session { }