Changeset dc803a7


Ignore:
Timestamp:
Mar 12, 2010 2:37:32 AM (14 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
7e50f69
Parents:
310d419
Message:

Set up all routing daemons from the fedkit and note interfaces we've added in a way that SEER's federated testbed will grok them.

Location:
fedkit
Files:
3 added
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • fedkit/Makefile

    r310d419 rdc803a7  
    33         config_from_tunnelip.pl active_config.pl combo.pl \
    44         prep_gateway.pl port_forward.pl setup_bridge.pl import_key.pl \
    5          protogeni_routing.pl start_seer.pl
     5         gated_routing.pl start_seer.pl ospf_routing.pl
    66
    77LIBRARIES=gateway_lib.pm
    88
    9 fedkit.tgz:     ${LIBRARIES} ${BINARIES} ${PATCHES}
     9PACKAGES=libevent-1.3b.tbz openospfd-4.0.tbz
     10
     11fedkit.tgz:     ${LIBRARIES} ${BINARIES} ${PATCHES} ${PACKAGES}
    1012        mkdir -p /tmp/fedkit/local/federation/bin
    1113        mkdir -p /tmp/fedkit/local/federation/lib
    1214        mkdir -p /tmp/fedkit/local/federation/etc
     15        mkdir -p /tmp/fedkit/local/federation/pkg
    1316        cp ${BINARIES} /tmp/fedkit/local/federation/bin
    1417        cp ${LIBRARIES} /tmp/fedkit/local/federation/lib
     18        cp ${PACKAGES} /tmp/fedkit/local/federation/pkg
    1519        tar czf fedkit.tgz -C /tmp/fedkit local
    1620        rm -rf /tmp/fedkit
  • fedkit/config_from_tunnelip.pl

    r310d419 rdc803a7  
    22
    33use strict;
     4use IO::File;
    45use IO::Pipe;
    56use Getopt::Long;
     
    1920my $router;                     # Router for the internet
    2021my $routedest;                  # Add host route to this address (if given)
     22my $recordfile;                 # Record interfaces
    2123
    2224# Linux and FreeBSD use slightly different route syntax, so get the OS
     
    2527
    2628# Option parsing, --destination sets $routedest
    27 GetOptions('destination=s' => \$routedest);
     29GetOptions('destination=s' => \$routedest, "record=s" => \$recordfile);
    2830
    2931# Parse out the info about tunnelips
     
    7173}
    7274else { warn "Destination but no router\n" if $routedest; }
     75if ($recordfile) {
     76    $netmask = "255.255.255.0" unless $netmask;
     77    my $rf = new IO::File(">>$recordfile") ||
     78        die "Can't open $recordfile:$!\n";
     79    print $rf "$ip:$interface:$mac:$netmask\n";
     80    $rf->close();
     81}
    7382exit(0);
  • fedkit/federate.pl

    r310d419 rdc803a7  
    123123copy("/tmp/hosts", "/etc/hosts");
    124124
    125 # Ick.  at least one of our images has gated in the wrong place (sigh).  If
    126 # so, fix it and restart routing. 
    127 if (!-x "/usr/sbin/gated" && -x "/sbin/gated" ) {
    128     print "Linking to /sbin/gated and starting routing\n";
    129     symlink("/sbin/gated", "/usr/sbin/gated");
    130     system("$RC_ROUTE boot") if -x $RC_ROUTE;
    131 }
    132 
    133 # If there are tunnelip interfaces to bring up, bring 'em
     125
     126# If there are tunnelip interfaces to bring up, bring 'em up.  Record any such
     127# interfaces in /usr/local/federation/interfaces, so SEER can find them later.
    134128system("$perl -I/usr/local/federation/lib " .
    135     "/usr/local/federation/bin/config_from_tunnelip.pl");
     129    "/usr/local/federation/bin/config_from_tunnelip.pl " .
     130    "--record=/usr/local/federation/etc/interfaces");
     131
     132if ($uname =~ /Linux/ ) {
     133    system("$perl /usr/local/federation/bin/gated_routing.pl")
     134        if -r "/usr/local/federation/bin/gated_routing.pl";
     135}
     136elsif ($uname =~/FreeBSD/ ) {
     137    # FreeBSD needs to have ospfs installed and a router config created and
     138    # run.
     139    system("$perl /usr/local/federation/bin/ospf_routing.pl")
     140        if -r "/usr/local/federation/bin/ospf_routing.pl";
     141}
    136142
    137143
  • fedkit/gated_routing.pl

    r310d419 rdc803a7  
    66
    77my $IFCONFIG = "/sbin/ifconfig";
    8 my $GATED= "/usr/sbin/gated";
     8my @GATEDS= ("/usr/sbin/gated", "/sbin/gated" );
     9my $GATED;
    910
    1011my $fn = "/usr/local/federation/etc/gated.conf";
     
    2122}
    2223$ifp->close();
     24
     25foreach my $g (@GATEDS) {
     26    if (-x $g ) {
     27        $GATED = $g;
     28        last;
     29    }
     30}
     31
     32die "Can't find gated in " . join(",", @GATEDS) . "\n" unless $GATED;
    2333
    2434my $f = new IO::File(">$fn") || die "Can't open $fn: $!\n";
Note: See TracChangeset for help on using the changeset viewer.