Cisco—BGP

ADDRESS-FAMILY

en
conf t
    # 設定bgp process id
    router bgp 10

        # 設定BGP的RID,通常指定loopback ip
        bgp router-id 10.10.10.10

        # 設定鄰居是誰
        neighbor 192.168.1.1 remote-as 10
        neighbor 192.168.2.1 remote-as 20

        # BGP走哪一個協議
        address-family ipv4 unicast

            # 設定鄰居啟用
            neighbor 192.168.1.1 activate
            neighbor 192.168.2.1 activate 

            # 本機有哪一些網段要參與BGP
            network 10.10.10.10 mask 255.255.255.255
            network 20.20.20.20 mask 255.255.255.255

        end
wr

# 檢查bgp路由狀態
show ip bgp

# 檢查鄰居狀態
show ip bgp summary

# 檢查路由表
show ip route [bgp]

LEGACY-IPv4

en
conf t
    router bgp 10
        bgp router-id 10.10.10.10
        
        neighbor 192.168.1.1 remote-as 10
        neightbor 192.168.2.1 remote-as 20
        network 10.10.10.10 mask 255.255.255.255
        network 20.20.20.20 mask 255.255.255.255

    end
wr