Ignore:
Timestamp:
Feb 7, 2014 2:53:02 PM (10 years ago)
Author:
Ted Faber <faber@…>
Branches:
master
Children:
5f5ce09
Parents:
bea19b7
Message:

DEV push

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/desktop_access.py

    rbea19b7 rb06744b  
    342342        port = None
    343343        my_addr = None
     344        my_name = None
    344345        for e in top.elements:
    345346            if not isinstance(e, topdl.Computer): continue
    346347            if e.get_attribute('portal') is None:
     348                my_name = e.name
    347349                # there should be one interface with one IPv4 address
    348350                if len(e.interface) <1 :
     
    369371        dscript = os.path.join(self.localdir, 'disconnect')
    370372        local_hosts = os.path.join(self.localdir, 'hosts')
     373        zebra_conf = os.path.join(self.localdir, 'zebra.conf')
     374        ospfd_conf = os.path.join(self.localdir, 'ospfd.conf')
    371375        try:
    372376            f = open(cscript, 'w')
     
    393397            print >>f, 'ifconfig tap0 %s netmask 255.255.255.0 up' % \
    394398                    my_addr
    395             self.set_route('10.0.0.0/8', f, exp_peer)
     399            # self.set_route('10.0.0.0/8', f, exp_peer)
     400            print >>f, '/usr/local/sbin/zebra -d -i -f %s' % zebra_conf
     401            print >>f, '/usr/local/sbin/ospfd -d -i -f %s' % ospfd_conf
    396402            f.close()
    397403            os.chmod(cscript, 0755)
     
    400406            print >>f, 'ifconfig tap0 destroy'
    401407            self.unset_route(peer, f)
    402             self.unset_route('10.0.0.0/8', f)
     408            #self.unset_route('10.0.0.0/8', f)
    403409            print >>f, 'mv /etc/hosts.DETER.fedd.hold /etc/hosts'
     410            print >>f, 'kill `cat /var/run/ospfd.pid`'
     411            print >>f, 'kill `cat /var/run/zebra.pid`'
    404412            f.close()
    405413            os.chmod(dscript, 0755)
     414            f = open(zebra_conf, 'w')
     415            print >>f, 'hostname %s' % my_name
     416            print >>f, 'interface tap0'
     417            f.close()
     418            os.chmod(zebra_conf, 0644)
     419            f = open(ospfd_conf, 'w')
     420            print >>f, 'hostname %s' % my_name
     421            print >>f, 'router ospf'
     422            print >>f, ' redistribute static'
     423            print >>f, ' network %s/24 area 0.0.0.2' % my_addr
    406424        except EnvironmentError, e:
    407425            raise service_error(service_error.internal,
Note: See TracChangeset for help on using the changeset viewer.