#!/usr/bin/perl use strict; use gateway_lib; use IO::File; use Getopt::Long; my $ssh_pubkey; my $ssh_privkey; my $tunnelip; my $peer; my $fedkit_dir= "/usr/local/federation"; my $perl = "/usr/bin/perl"; my $iface_file; my $ssh = "/usr/bin/ssh"; my @ports; exit(20) unless GetOptions( 'ssh_pubkey=s' => \$ssh_pubkey, 'ssh_privkey=s' => \$ssh_privkey, 'tunnelip' => \$tunnelip, 'peer=s' => \$peer, 'fedkit=s' => \$fedkit_dir, 'perl=s' => \$perl, 'interfaces=s' => \$iface_file, 'ssh=s' => \$ssh, 'port=s', \@ports, ); my $tunnelparam = $tunnelip ? '--tunnelip' : ''; my $portparam = join(" --port=", @ports); # join doesn't prefix the first one $portparam="--port=$portparam" if $portparam; system("$perl -I$fedkit_dir/lib $fedkit_dir/bin/active_config.pl " . "--peer=$peer --ssh_pubkey=$ssh_pubkey --ssh_privkey=$ssh_privkey " . " $tunnelparam --fedkit=$fedkit_dir --perl=$perl " . "--ssh=$ssh --interfaces=$iface_file"); exit(20) if $?; system("$perl -I$fedkit_dir/lib $fedkit_dir/bin/port_forward.pl " . "--peer=$peer --ssh_pubkey=$ssh_pubkey --ssh_privkey=$ssh_privkey " . " $tunnelparam --fedkit=$fedkit_dir --perl=$perl " . "--ssh=$ssh $portparam"); exit(20) if $?; =pod =head1 NAME B - Do both the active configuration of a connectiveity gateway and service port forwarding. =head1 OPTIONS =over 8 =item BI Directory in which this software is installed. Generally not needed. =item BI A list of interfaces to forward data on of the form: =begin text iface ip_addr =end text The interface is the operating system name of the interface and the IP address is given in standard dotted decimal notation. Other characters on a line are ignored. =item BI The other gateway providing forwarding. =item BI Location of the perl binary. Usually unneeded. =item BI Forward the given port. The port is specified as for B =item BI The pathname of the ssh binary. Unusally unnecessary. =item BI A public to install as authorized. =item BI The identity to use for remote access =item B True if the testbed uses the DETER tunnelip extension to provide external connectivity information =back =head1 SYNOPSIS Call B and B with the relevant parameters. =head1 AUTHORS Ted Faber =cut