/[pxelator]/lib/PXElator/network.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/PXElator/network.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 140 by dpavlin, Tue Aug 4 17:16:11 2009 UTC revision 179 by dpavlin, Sun Aug 9 16:37:46 2009 UTC
# Line 14  sub ifconfig { Line 14  sub ifconfig {
14    
15  sub tap {  sub tap {
16    
17            if ( my $dev = $ENV{DEV} ) {
18                    warn "W: running under device $dev, not configuring tap0\n";
19                    return;
20            }
21    
22            if ( $server::ip !~ m{^172} ) {
23                    warn "W: server ip mismetch, not configuring tap0\n";
24                    return;
25            }
26    
27          my $interfaces = read_file '/etc/network/interfaces';          my $interfaces = read_file '/etc/network/interfaces';
28    
29          if ( $interfaces !~ m{tap0}s ) {          if ( $interfaces !~ m{tap0}s ) {
# Line 27  iface tap0 inet static Line 37  iface tap0 inet static
37          address $server::ip          address $server::ip
38          netmask $server::netmask          netmask $server::netmask
39          vde2-switch -          vde2-switch -
40            # setup NAT for vde network
41            post-up sysctl -w net.ipv4.ip_forward=1
42            post-up iptables -t nat -A POSTROUTING -s $server::ip/$server::netmask -o wlan0 -j MASQUERADE
43    
44                  };                  };
45    

Legend:
Removed from v.140  
changed lines
  Added in v.179

  ViewVC Help
Powered by ViewVC 1.1.26