#!/usr/bin/perl use strict; use gateway_lib; use Getopt::Long; use IO::File; my $tapno; my $addr; my $iface; my $fedkit_dir= "/usr/local/federation"; my $perl = "/usr/bin/perl"; my $peer; my $use_file; my %opts = ( 'tapno=s' => \$tapno, 'addr=s' => \$addr, 'peer=s' => \$peer, 'use_file', \$use_file, ); exit(20) unless GetOptions(%opts); gateway_lib::read_config(gateway_lib::config_filename(), \%opts) if $use_file; die "Need an address\n" unless $addr; # Get the interface to reset my $f = new IO::File("/tmp/interface$tapno") || die "Cannot open interface file\n"; while (<$f>) { chomp; $iface = $_; } $f->close( ); print "iface is $iface\n"; gateway_lib::configure_outgoing_iface($iface, $addr); exit(0); =pod =head1 NAME B - Restore the given IP address to the interface bridged to the given tapno. =head1 OPTIONS =over 8 =item BI
Address of the local interface to restore. =item BI The tap interface that generated the interface save file. =item B If given read additional parameters from the file in /proj/I/exp/I/tmp/I.gw/conf where those are the current testbed project and experiment and the hostname is before the first dot. The file is option: value. =back =head1 SYNOPSIS B restores a previously assigned IP address to an interface. That interface name was saved by B, before it was removed for bridging. =head1 AUTHORS Ted Faber =cut