IHANet Home‎ > ‎samples‎ > ‎

JUNOSでのBGP接続方法

interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet6 {
                /* インタフェースへIPv6アドレスを設定 */
                address 2001:240:633:1234::1/64;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet6 {
                /* Subnet router anycast のつもり(これで良いかは???) */
                address 2001:240:633::/128;
            }
        }
    }
}
routing-options {
    rib inet6.0 {
        static {
            /* 広告するPrefixをルーティングテーブルに載せておく */
            route 2001:240:633::/48 reject;
        }
    }
    /* 自分のAS番号を設定 */
    autonomous-system 64524;
}
protocols {
    bgp {
        group iBGP-AS64524 {
            /* iBGPの例 */
            type internal;
            local-address 2001:240:633:1234::1;
            neighbor 2001:240:633:1234::2;
        }
        group IHANet {
            /* eBGPの例 */
            type external;
            /* local-addressにlink-local addressを指定した場合、どのインタフェースかをlocal-interfaceで指定する */
            local-address fe80::b:0:fc0c:101;
            local-interface ge-0/0/0.0;
            advertise-inactive;
            export export-IHANet;
            neighbor fe80::1:0:fc11:10 {
                peer-as 64529;
            }
            neighbor fe80::1:0:fc1e:1 {
                peer-as 64542;
            }
        }
    }
}
policy-options {
    policy-statement export-IHANet {
        term 1 {
            from {
                protocol static;
                route-filter 2001:240:633::/48 exact;
            }
            then accept;
        }
        term 2 {
            from protocol bgp;
            then accept;
        }
        term 3 {
            then reject;
        }
    }
}