添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
config = '! \n\r version 12.2 \n\r service timestamps debug uptime \n\r service timestamps log uptime \n\r no service password-encryption \n ! \n hostname PE1 \n\r ! \n boot-start-marker \n boot-end-marker \n ! \n ! \n no aaa new-model \n ip subnet-zero \n ip source-route \n ! \n ! \n ! \n ! \n ip cef \n no ip domain lookup \n ! \n ! \n multilink bundle-name authenticated \n no mpls traffic-eng auto-bw timers \n mpls label range 100 199 \n call rsvp-sync \n ! \n ! \n ! \n ! \n ! \n ! \n ! \n ! \n ! \n pseudowire-class EoMPLS \n encapsulation mpls \n ! \n ! \n ! \n ! \n ! \n ! \n ! \n interface Loopback0 \n ip address 1.1.1.1 255.255.255.255 \n no clns route-cache \n ! \n interface FastEthernet0/0 \n description ***connect to CE1 ethernet Port**** \n no ip address \n speed auto \n duplex half \n no clns route-cache \n xconnect 2.2.2.2 100 pw-class EoMPLS \n ! \n interface FastEthernet0/1 \n no ip address \n shutdown \n speed auto \n duplex auto \n ! \n interface Serial1/0 \n description ***connect to P*** \n ip address 150.1.13.1 255.255.255.0 \n mpls ip \n serial restart-delay 0 \n no clns route-cache \n ! \n interface Serial1/1 \n no ip address \n shutdown \n serial restart-delay 0 \n no clns route-cache \n ! \n interface Serial1/2 \n no ip address \n shutdown \n serial restart-delay 0 \n no clns route-cache \n ! \n interface Serial1/3 \n no ip address \n shutdown \n serial restart-delay 0 \n no clns route-cache \n ! \n interface FastEthernet2/0 \n no ip address \n speed auto \n duplex auto \n no cdp enable \n no clns route-cache \n ! \n interface FastEthernet2/0.110 \n encapsulation dot1Q 110 \n xconnect 2.2.2.2 110 pw-class EoMPLS \n ! \n interface FastEthernet2/1 \n no ip address \n shutdown \n speed auto \n duplex auto \n no clns route-cache \n ! \n router ospf 1 \n router-id 1.1.1.1 \n log-adjacency-changes \n network 1.1.1.1 0.0.0.0 area 0 \n network 150.1.13.1 0.0.0.0 area 0 \n ! \n ip classless \n ! \n ! \n no ip http server \n no ip http secure-server \n ! \n ! \n ! \n ! \n control-plane \n ! \n ! \n dial-peer cor custom \n ! \n ! \n ! \n ! \n gatekeeper \n shutdown \n ! \n ! \n line con 0 \n exec-timeout 0 0 \n logging synchronous \n stopbits 1 \n line aux 0 \n stopbits 1 \n line vty 0 4 \n no login \n ! \n end \n\r quitshut \n ' # 将字符串中的'\r'删除 config = re . sub ( ' \r ' , '' , config , flags = re . DOTALL ) # 将字符串顶部的'version 12.2'删除 config = re . sub ( 'version /d*./d*' , '' , config , flags = re . DOTALL ) # 将字符串底部的'end'后的所有字符删除 config = re . sub ( ' \n end.*' , ' \n end' , config , flags = re . DOTALL ) print config