source: fedkit/setup_bridge.pl @ cf9598a

compt_changesinfo-ops
Last change on this file since cf9598a was c6d6c43, checked in by Mike Ryan <mikeryan@…>, 13 years ago

mass typo in perldoc
nice cut & paste job faber

  • Property mode set to 100644
File size: 2.0 KB
Line 
1#!/usr/bin/perl
2
3use strict;
4
5use gateway_lib;
6
7use Getopt::Long;
8
9my $tapno;
10my $addr;
11my $dest;
12my $iface;
13my $fedkit_dir= "/usr/local/federation";
14my $perl = "/usr/bin/perl";
15my $use_file;
16my %opts = (
17    'tapno=s' => \$tapno,
18    'addr=s' => \$addr,
19    'dest=s' => \$dest,
20    'use_file', \$use_file,
21);
22
23exit(20) unless GetOptions(%opts);
24gateway_lib::read_config(gateway_lib::emulab_config_filename(), \%opts)
25    if $use_file;
26
27die "Only one of dest and addr is allowed\n" if $addr && $dest;
28
29$iface = $dest ? 
30    gateway_lib::dest_to_iface($dest) : gateway_lib::addr_to_iface($addr) 
31        if !$iface;
32
33print "iface is $iface\n";
34
35gateway_lib::bind_tap_to_iface($tapno, $iface);
36
37exit(0);
38
39=pod
40
41=head1 NAME
42
43B<setup_bridge.pl> - Connect a tap and local interface.  Called both remotely
44and locally to establish the two sides of the bridge.
45
46=head1 OPTIONS
47
48=over 8
49
50=item B<addr=>I<address>
51
52Address of the local interface to connect to the given tap interface on the
53given bridge interface.
54
55=item B<dest=>I<destination>
56
57Attach the interface on which I<destination> can be reached to the given
58tap/bridge combo.
59
60=item B<tapno=>I<integer>
61
62The tap interafce to connect. This will be the integer that follows tap and
63bridge in the interface names.
64
65=item B<use_file>
66
67If given read additional parameters from the file in
68/proj/I<project>/exp/I<experiment>/tmp/I<hostname>.gw/conf where those are the
69current testbed project and experiment and the hostname is before the first
70dot.  The file is option: value.
71
72
73=back
74
75=head1 SYNOPSIS
76
77B<setup_bridge.pl> Connects the established ssh tunnel (a tap interface) to
78a local interface through a bridge interface.  Traffic on the local interface
79will cross the network over the ssh tunnel and be released onto the net via a
80symmetrical setup on the peer.
81
82The interface to attach can be given either by its interface or an address/DNS
83name to reach.  In either case, all IP addresses are removed from the
84bound interface.
85
86=head1 AUTHORS
87
88Ted Faber <faber@isi.edu>
89
90=cut
Note: See TracBrowser for help on using the repository browser.