mpls ldp neighbor 和loopbak

 

 

mpls2# show mpls ldp neighbor 
AF   ID              State       Remote Address    Uptime
mpls2# 
mpls ldp
 router-id 192.168.122.164
 !
 address-family ipv4
  discovery transport-address 192.168.122.164
  !
  interface enp1s0
  !
 exit-address-family
 !
!
line vty
!
end

 

mpls2# sh  ip ospf int
enp1s0 is up
  ifindex 2, MTU 1500 bytes, BW 4294967295 Mbit <UP,BROADCAST,RUNNING,MULTICAST>
  Internet Address 192.168.123.164/24, Broadcast 192.168.123.255, Area 0.0.0.0
  MTU mismatch detection: enabled
  Router ID 192.168.122.164, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State DR, Priority 1
  No backup designated router on this network
  Multicast group memberships: OSPFAllRouters OSPFDesignatedRouters
  Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
    Hello due in 8.027s
  Neighbor Count is 0, Adjacent neighbor count is 0
enp5s0 is up
  ifindex 3, MTU 1500 bytes, BW 4294967295 Mbit <UP,BROADCAST,RUNNING,MULTICAST>
  This interface is UNNUMBERED, Area 0.0.0.0
  MTU mismatch detection: enabled
  Router ID 192.168.122.164, Network Type POINTOPOINT, Cost: 1
  Transmit Delay is 1 sec, State Point-To-Point, Priority 1
  No backup designated router on this network
  Multicast group memberships: OSPFAllRouters
  Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
    Hello due in 7.045s
  Neighbor Count is 2, Adjacent neighbor count is 1
enp6s0 is up
  ifindex 4, MTU 1500 bytes, BW 4294967295 Mbit <UP,BROADCAST,RUNNING,MULTICAST>
  This interface is UNNUMBERED, Area 0.0.0.0
  MTU mismatch detection: enabled
  Router ID 192.168.122.164, Network Type POINTOPOINT, Cost: 1
  Transmit Delay is 1 sec, State Point-To-Point, Priority 1
  No backup designated router on this network
  Multicast group memberships: OSPFAllRouters
  Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
    Hello due in 7.045s
  Neighbor Count is 2, Adjacent neighbor count is 1

mpls2# 

 

mpls2# sh   int
Interface enp1s0 is up, line protocol is up
  Link ups:       0    last: (never)
  Link downs:     0    last: (never)
  vrf: default
  index 2 metric 0 mtu 1500 speed 4294967295 
  flags: <UP,BROADCAST,RUNNING,MULTICAST>
  Type: Ethernet
  HWaddr: 52:54:00:73:55:cd
  inet 192.168.123.164/24
  Interface Type Other
Interface enp5s0 is up, line protocol is up
  Link ups:       0    last: (never)
  Link downs:     0    last: (never)
  vrf: default
  index 3 metric 0 mtu 1500 speed 4294967295 
  flags: <UP,BROADCAST,RUNNING,MULTICAST>
  Type: Ethernet
  HWaddr: 52:54:00:ea:64:6e
  inet 192.168.2.4/32 peer 192.168.2.5/32 unnumbered
  inet6 fe80::5054:ff:feea:646e/64
  Interface Type Other
Interface enp6s0 is up, line protocol is up
  Link ups:       0    last: (never)
  Link downs:     0    last: (never)
  vrf: default
  index 4 metric 0 mtu 1500 speed 4294967295 
  flags: <UP,BROADCAST,RUNNING,MULTICAST>
  Type: Ethernet
  HWaddr: 52:54:00:d7:a1:de
  inet 192.168.1.4/32 peer 192.168.1.3/32 unnumbered
  Interface Type Other
Interface lo is up, line protocol is up
  Link ups:       0    last: (never)
  Link downs:     0    last: (never)
  vrf: default
  index 1 metric 0 mtu 65536 speed 0 
  flags: <UP,LOOPBACK,RUNNING>
  Type: Loopback
  Interface Type Other
mpls2# 

 

mpls ldp
 router-id 192.168.122.164
 !
 address-family ipv4
  discovery transport-address 192.168.122.164
  !
  interface enp1s0
  !
 exit-address-family
 !
!
line vty
!
end
mpls2# conf t
mpls2(config)# address-family ipv4
% Unknown command: address-family ipv4
mpls2(config)# mpls ldp
mpls2(config-ldp)# address-family ipv4
mpls2(config-ldp-af)# discovery transport-address 192.168.1.4
mpls2(config-ldp-af)# discovery transport-address 192.168.2.4
mpls2(config-ldp-af)# end
mpls2# wr
Note: this version of vtysh never writes vtysh.conf
Building Configuration...
Integrated configuration saved to /etc/frr/frr.conf
[OK]
mpls2# show run
Building configuration...

Current configuration:
!
frr version 7.3.1
frr defaults traditional
hostname mpls2
log file /var/log/frr/ospfd.log
log syslog informational
service integrated-vtysh-config
!
debug ospf event
debug ospf packet all
!
interface enp5s0
 ip ospf network point-to-point
!
interface enp6s0
 ip ospf network point-to-point
!
router ospf
 ospf router-id 192.168.122.164
 redistribute connected
 redistribute static
 network 4.4.4.4/32 area 0
 network 192.168.1.0/24 area 0
 network 192.168.2.0/24 area 0
 network 192.168.123.0/24 area 0
!
mpls ldp
 router-id 192.168.122.164
 !
 address-family ipv4
  discovery transport-address 192.168.2.4
  !
  interface enp1s0
  !
 exit-address-family
 !
!
line vty
!
end
mpls2# 

 

 

mpls3和mpls2建立

 

 

 

 

 

 

 

mpls2# conf t
mpls2(config)# mpls ldp
mpls2(config-ldp)# router-id 192.168.1.4
mpls2(config-ldp)#  address-family ipv4
mpls2(config-ldp-af)# discovery transport-address 192.168.1.4
mpls2(config-ldp-af)# interface enp6s0
mpls2(config-ldp-af-if)# exit-address-family
mpls2(config-ldp)# end
mpls2# wr
Note: this version of vtysh never writes vtysh.conf
Building Configuration...
Integrated configuration saved to /etc/frr/frr.conf
[OK]
mpls2# sh run
Building configuration...

Current configuration:
!
frr version 7.3.1
frr defaults traditional
hostname mpls2
log file /var/log/frr/ospfd.log
log syslog informational
service integrated-vtysh-config
!
debug ospf event
debug ospf packet all
!
interface enp5s0
 ip ospf network point-to-point
!
interface enp6s0
 ip ospf network point-to-point
!
router-id 192.168.1.4
!
router ospf
 ospf router-id 192.168.122.164
 redistribute connected
 redistribute static
 network 4.4.4.4/32 area 0
 network 192.168.1.0/24 area 0
 network 192.168.2.0/24 area 0
 network 192.168.123.0/24 area 0
!
mpls ldp
 router-id 192.168.1.4 -----------------以前的没有了哦
 !
 address-family ipv4
  discovery transport-address 192.168.1.4
  !
  interface enp5s0
  !
  interface enp6s0
  !
 exit-address-family
 !
!
line vty
!
end

 

 

mpls1# sh mpls ldp nei
AF   ID              State       Remote Address    Uptime
ipv4 192.168.1.4     OPERATIONAL 192.168.1.4     00:15:23
mpls1#  sh mpls ldp 
binding       capabilities  discovery     interface     ipv4          ipv6          neighbor      
mpls1#  sh mpls ldp di
AF   ID              Type     Source           Holdtime
ipv4 192.168.1.4     Link     enp7s0                 15

mpls1# sh m
mac      memory   modules  mpls     
mpls1# sh m
mac      memory   modules  mpls     
mpls1# sh mpls 
fec          ldp          pseudowires  status       table        
mpls1# sh mpls fec
mpls1# sh mpls table
 Inbound Label  Type  Nexthop         Outbound Label  
 -----------------------------------------------------
 16             LDP   192.168.1.4     implicit-null   
 17             LDP   192.168.1.4     implicit-null   
 18             LDP   192.168.122.35  implicit-null   
 19             LDP   192.168.1.4     implicit-null   

mpls1# sh mpls fec
mpls1# sh mpls ldp 
binding       capabilities  discovery     interface     ipv4          ipv6          neighbor 

 

现在给各个节点添加一个loopbak

 

 

mpls1

mpls1# sh 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 4.4.4.3/32 area 0
 network 192.168.1.0/24 area 0
 network 192.168.124.0/24 area 0
!
mpls ldp
 router-id 192.168.122.198
 !
 address-family ipv4
  discovery transport-address 4.4.4.3
  !
  interface enp7s0
  !
  interface lo1
  !
 exit-address-family
 !
!
line vty
!
end
mpls1# 

 

mpls3

mpls3# sh run
Building configuration...

Current configuration:
!
frr version 7.3.1
frr defaults traditional
hostname mpls3
log file /var/log/frr/ospfd.log
log syslog informational
service integrated-vtysh-config
!
debug ospf event
debug ospf packet all
!
interface enp7s0
 ip ospf network point-to-point
!
router-id 192.168.122.35
!
router ospf
 ospf router-id 192.168.122.35
 redistribute connected
 redistribute static
 network 4.4.4.5/32 area 0
 network 192.168.2.0/24 area 0
 network 192.168.122.0/24 area 0
!
mpls ldp
 router-id 192.168.122.35
 !
 address-family ipv4
  discovery transport-address 4.4.4.5
  !
  interface enp7s0
  !
  interface lo1
  !
 exit-address-family
 !
!
line vty
!
end
mpls3# 

 

mls2

mpls2# sh run
Building configuration...

Current configuration:
!
frr version 7.3.1
frr defaults traditional
hostname mpls2
log file /var/log/frr/ospfd.log
log syslog informational
service integrated-vtysh-config
!
debug ospf event
debug ospf packet all
!
interface enp5s0
 ip ospf network point-to-point
!
interface enp6s0
 ip ospf network point-to-point
!
router-id 192.168.1.4
!
router ospf
 ospf router-id 192.168.122.164
 redistribute connected
 redistribute static
 network 4.4.4.4/32 area 0
 network 192.168.1.0/24 area 0
 network 192.168.2.0/24 area 0
 network 192.168.123.0/24 area 0
!
mpls ldp
 router-id 192.168.1.4
 !
 address-family ipv4
  discovery transport-address 4.4.4.4
  !
  interface enp5s0
  !
  interface enp6s0
  !
  interface lo1
  !
 exit-address-family
 !
!
line vty
!
end
mpls2# 

 

mpls2# sh mpls ldp nei
AF   ID              State       Remote Address    Uptime
ipv4 192.168.122.198 OPERATIONAL 4.4.4.3         00:00:35
ipv4 192.168.122.35  OPERATIONAL 4.4.4.5         00:04:52

 

 

root@mpls1:/home/devuser# cat vm.sh 
ip link add ethc2 type dummy
ip link set ethc2 up
ip addr add 172.19.2.4/24 dev ethc2
ip link add customer2 type vrf table 200
ip link set customer2 up
ip route add vrf customer2 unreachable default metric 4278198272
ip -6 route add vrf customer2 unreachable default metric 4278198272
ip link add ethc1 type dummy
ip link set ethc1 up
ip addr add 172.19.2.4/24 dev ethc1
ip link add customer1 type vrf table 100
ip link set customer1 up
ip route add vrf customer1 unreachable default metric 4278198272
ip -6 route add vrf customer1 unreachable default metric 4278198272
ip link set ethc1 vrf customer1

 

posted on 2020-07-30 19:17  tycoon3  阅读(327)  评论(0编辑  收藏  举报

导航