compt_changes
Last change
on this file since 5ae9d94 was
dc803a7,
checked in by Ted Faber <faber@…>, 15 years ago
|
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.
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | #!/usr/bin/perl |
---|
2 | |
---|
3 | use strict; |
---|
4 | use IO::File; |
---|
5 | use IO::Pipe; |
---|
6 | |
---|
7 | my $IFCONFIG = "/sbin/ifconfig"; |
---|
8 | my $OSPFD= "/usr/local/sbin/ospfd"; |
---|
9 | my $SYSCTL= "/sbin/sysctl"; |
---|
10 | my $PKG_ADD="/usr/sbin/pkg_add"; |
---|
11 | |
---|
12 | my $fn = "/usr/local/federation/etc/ospfd.conf"; |
---|
13 | my @pkgs = ('/usr/local/federation/pkg/libevent-1.3b.tbz', |
---|
14 | '/usr/local/federation/pkg/openospfd-4.0.tbz'); |
---|
15 | my @live_ones; |
---|
16 | |
---|
17 | for my $p (@pkgs) { |
---|
18 | die "No such package $p\n" unless -r $p; |
---|
19 | } |
---|
20 | |
---|
21 | system("$PKG_ADD " . join(" ", @pkgs)); |
---|
22 | |
---|
23 | chomp (my $cif = `/usr/local/etc/emulab/control_interface`); |
---|
24 | |
---|
25 | my $ifp = new IO::Pipe(); |
---|
26 | $ifp->reader("$IFCONFIG"); |
---|
27 | while (<$ifp>) { |
---|
28 | /^(\S+):.*UP/ && do { |
---|
29 | push(@live_ones, $1) unless $1 eq $cif || $1 eq "lo0"; |
---|
30 | }; |
---|
31 | } |
---|
32 | $ifp->close(); |
---|
33 | |
---|
34 | my $f = new IO::File(">$fn") || die "Can't open $fn: $!\n"; |
---|
35 | print $f <<END; |
---|
36 | area 0.0.0.1 { |
---|
37 | interface $cif { |
---|
38 | passive |
---|
39 | } |
---|
40 | } |
---|
41 | END |
---|
42 | print $f <<END; |
---|
43 | area 0.0.0.2 { |
---|
44 | auth-type none |
---|
45 | END |
---|
46 | foreach my $i (@live_ones) { |
---|
47 | print $f "\tinterface $i {\n\t}\n"; |
---|
48 | } |
---|
49 | print $f "}\n"; |
---|
50 | $f->close(); |
---|
51 | system("chmod 600 $fn"); |
---|
52 | system("$SYSCTL -w net.inet.ip.forwarding=1"); |
---|
53 | system("$OSPFD -f $fn"); |
---|
54 | |
---|
Note: See
TracBrowser
for help on using the repository browser.