How to establish IPv6 BGP session with others.

First you should setup a new interface for binding the IPv6 of yours to it, you can write a systemd configuration like this:

Description=IPv6 tunnel interface

ExecStart=/usr/bin/ip l a dev <interface_name> type dummy
ExecStart=/usr/bin/ip l s <interface_name> up
ExecStart=/usr/bin/ip a a <IPv6 subnet> dev <interface_name>
ExecStop=/usr/bin/ip a d <IPv6 subnet> dev <interface_name>
ExecStop=/usr/bin/ip l s <interface_name> down
ExecStop=/usr/bin/ip l d dev <interface_name> type dummy


Next, you should setup a GRE connection with others like this,

Description=IPv6 tunnel

ExecStart=/usr/bin/ip tunnel add <tunnel_name> mode gre remote <remote_IP> local <local_IP> ttl 255
ExecStart=/usr/bin/ip l s <tunnel_name> up mtu 1476
ExecStart=/usr/bin/ip a a <IPv6 address of this side> dev <tunnel_name>
ExecStop=/usr/bin/ip l s <tunnel_name> down
ExecStop=/usr/bin/ip tunnel del <tunnel_name>


Now, you can setup bird6 to finish the process.

router id <IPv4-like ID>;
protocol bgp <BGP name>
    local as <local ASN>;
    source address <IPv6 address of your side>;
    import where net ~ [ ::/0 ];
    export where net ~ [ <IPv6 /44 subnet>::/44{44,48} ];
    graceful restart on;
    neighbor <IPv6 address of router side> as <router side ASN>;
    next hop self;

protocol static static1
    route <one of your IPv6 /48 subnets>::/48 via "<interface_name>";
    route <router IPv6 address>::/48 via "eth0"; 

protocol kernel {
        scan time 20;
        import none;
        export all;

protocol device {
    scan time 20;

protocol direct
    interface "<interface_name>";
    import all;

Do some cleaning.

systemctl enable bird6.service
systemctl enable tunnel-GRE.service
systemctl enable tunnel.service
systemctl start bird6.service
systemctl start tunnel.service
systemctl start tunnel-GRE.service

2 条评论

  1. 小白兔


  2. qianqian

    😆 yeah!A new post! prpr 😆