R1配置
interface Ethernet0/0/0
undo shutdown
ip address 172.16.1.1 255.255.255.0
interface Ethernet0/0/1
undo shutdown
ip address 192.168.1.1 255.255.255.0
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
ip address 100.100.100.100 255.255.255.255
network 100.100.100.100 255.255.255.255
peer 2.2.2.2 as-number 200
peer 2.2.2.2 ebgp-max-hop 2
peer 2.2.2.2 connect-interface LoopBack0
ip route-static 2.2.2.0 255.255.255.0 192.168.1.2
R2配置
interface Ethernet0/0/0
undo shutdown
ip address 172.16.1.2 255.255.255.0
interface Ethernet0/0/1
undo shutdown
ip address 192.168.1.2 255.255.255.0
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
bgp 200
peer 1.1.1.1 as-number 100
peer 1.1.1.1 ebgp-max-hop 2
peer 1.1.1.1 connect-interface LoopBack0
ip route-static 1.1.1.0 255.255.255.0 192.168.1.1