1. 程式人生 > 實用技巧 >Python斷言及常用斷言函式總結

Python斷言及常用斷言函式總結

point-to-point
mpls1# show ip ospf nei

Neighbor ID     Pri State           Dead Time Address         Interface                        RXmtL RqstL DBsmL
192.168.122.35    1 Full/Backup       34.190s 192.168.122.35  enp1s0:192.168.122.199               0     0     0
192.168.122.164   1 Full/DR           38
.262s 192.168.122.164 enp1s0:192.168.122.199 0 0 0 mpls1# show ip ospf nei Neighbor ID Pri State Dead Time Address Interface RXmtL RqstL DBsmL 192.168.122.35 1 Full/Backup 31.700s 192.168.122.35 enp1s0:192.168.122.199 0
0 0 192.168.122.164 1 Full/DR 35.772s 192.168.122.164 enp1s0:192.168.122.199 0 0 0 mpls1# conf t mpls1(config)# int enp7s0 mpls1(config-if)# ip ospf network point-to-point mpls1(config-if)# router ospf mpls1(config-router)# network 192.168.1.0/24 area 0 mpls1(config
-router)# end mpls1# wr Note: this version of vtysh never writes vtysh.conf Building Configuration... Integrated configuration saved to /etc/frr/frr.conf [OK] mpls1# show ip ospf nei Neighbor ID Pri State Dead Time Address Interface RXmtL RqstL DBsmL 192.168.122.35 1 Full/Backup 39.999s 192.168.122.35 enp1s0:192.168.122.199 0 0 0 192.168.122.164 1 Full/DR 34.070s 192.168.122.164 enp1s0:192.168.122.199 0 0 0 192.168.122.164 1 Full/DROther 30.909s 192.168.1.4 enp7s0:192.168.1.3 0 0 0 mpls1#

redistribute connected

redistribute static

mpls1# show ip route ospf
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

O   192.168.122.0/24 [110/1] is directly connected, enp1s0, 00:19:31
mpls1# router ospf
% Unknown command: router ospf
mpls1# conf t
mpls1(config)# router ospf
mpls1(config-router)# redistribute connected
mpls1(config-router)# redistribute static
mpls1(config-router)# end
mpls1# wr
Note: this version of vtysh never writes vtysh.conf
Building Configuration...
Integrated configuration saved to /etc/frr/frr.conf
[OK]
mpls1# show ip route ospf
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

O>* 192.168.1.3/32 [110/20] via 192.168.122.164, enp1s0, 00:00:12
O>* 192.168.2.4/32 [110/20] via 192.168.122.35, enp1s0, 00:00:37
O>* 192.168.2.5/32 [110/20] via 192.168.122.164, enp1s0, 00:00:12
O   192.168.122.0/24 [110/1] is directly connected, enp1s0, 00:22:26
mpls1# show run
Building configuration...

Current configuration:
!
frr version 7.3.1
frr defaults traditional
hostname mpls1
log syslog informational
service integrated-vtysh-config
!
interface enp7s0
 ip ospf network point-to-point
!
router ospf
 ospf router-id 192.168.122.198
 redistribute connected
 redistribute static
 network 192.168.1.0/24 area 0
 network 192.168.122.0/24 area 0
!
mpls ldp
 router-id 192.168.122.198
 !
 address-family ipv4
  discovery transport-address 192.168.122.198
  !
  interface enp1s0
  !
 exit-address-family
 !
!
line vty
!
end
mpls1# 

mpls1# show run
Building configuration...

Current configuration:
!
frr version 7.3.1
frr defaults traditional
hostname mpls1
log syslog informational
service integrated-vtysh-config
!
interface enp7s0
 ip ospf network point-to-point
!
router ospf
 ospf router-id 192.168.122.198
 redistribute connected
 redistribute static
 network 192.168.1.0/24 area 0
 network 192.168.122.0/24 area 0
!
mpls ldp
 router-id 192.168.122.198
 !
 address-family ipv4
  discovery transport-address 192.168.122.198
  !
  interface enp1s0
  !
 exit-address-family
 !
!
line vty
!
end
mpls1# show ip ospf database router

       OSPF Router with ID (192.168.122.198)


                Router Link States (Area 0.0.0.0)

  LS age: 9
  Options: 0x2  : *|-|-|-|-|-|E|-
  LS Flags: 0x6  
  Flags: 0x2 : ASBR
  LS Type: router-LSA
  Link State ID: 192.168.122.35 
  Advertising Router: 192.168.122.35
  LS Seq Number: 800000c5
  Checksum: 0x43cb
  Length: 48

   Number of Links: 2

    Link connected to: another Router (point-to-point)
     (Link ID) Neighboring Router ID: 192.168.122.198
     (Link Data) Router Interface address: 0.0.0.3
      Number of TOS metrics: 0
       TOS 0 Metric: 1

    Link connected to: a Transit Network
     (Link ID) Designated Router address: 192.168.122.199
     (Link Data) Router Interface address: 192.168.122.35
      Number of TOS metrics: 0
       TOS 0 Metric: 1


  LS age: 4
  Options: 0x2  : *|-|-|-|-|-|E|-
  LS Flags: 0x6  
  Flags: 0x2 : ASBR
  LS Type: router-LSA
  Link State ID: 192.168.122.164 
  Advertising Router: 192.168.122.164
  LS Seq Number: 8000002b
  Checksum: 0xeaf6
  Length: 36

   Number of Links: 1

    Link connected to: a Transit Network
     (Link ID) Designated Router address: 192.168.122.199
     (Link Data) Router Interface address: 192.168.122.164
      Number of TOS metrics: 0
       TOS 0 Metric: 1


  LS age: 3
  Options: 0x2  : *|-|-|-|-|-|E|-
  LS Flags: 0x3  
  Flags: 0x2 : ASBR
  LS Type: router-LSA
  Link State ID: 192.168.122.198 
  Advertising Router: 192.168.122.198
  LS Seq Number: 800000bd
  Checksum: 0x7cd0
  Length: 48

   Number of Links: 2

    Link connected to: another Router (point-to-point)
     (Link ID) Neighboring Router ID: 192.168.122.164
     (Link Data) Router Interface address: 0.0.0.3
      Number of TOS metrics: 0
       TOS 0 Metric: 1

    Link connected to: a Transit Network
     (Link ID) Designated Router address: 192.168.122.199
     (Link Data) Router Interface address: 192.168.122.199
      Number of TOS metrics: 0
       TOS 0 Metric: 1


mpls1#