CentOS 7 使用 bird 广播 (组播) ipv4 和 ipv6

  • A+
所属分类:Linux网络
#安装必要软件包
yum install net-tools bird bird6 -y
#设置Bird和Bird6开机启动
systemctl enable bird.service bird6.service
#备份默认配置文件(里面注释很好,有必要的时候可以回来翻看)
cp /etc/bird.conf{,_backup_default}
cp /etc/bird6.conf{,_backup_default}
#开始配置ipv6
vi /etc/bird6.con

ip link add dev dummy1 type dummy && ip link set dummy1 up && ip addr add dev dummy1 2404:eb40:1::/48
ip addr add dev dummy1 2404:eb40:2::/48 && ip addr add dev dummy1 2404:eb40:3::/48 && ip addr add dev dummy1 2404:eb40:100::/48
for i in 1 2 3 100;do ip -6 addr add 2404:eb40:$i::1/64 dev eth0;done
for i in 100 110 120 130 140 150 160 170 180 190 200 210 220;do ip -6 addr add 2404:eb40:100::$i/64 dev eth0;done

#查看运行状态
systemctl status bird6.service
birdc6 show proto all bgp_vultr_v6_1 && birdc6 show route

下面是我的IPV6广播配置示例

/*
 *  This is an example configuration file.
 */

router id 108.160.134.223;

protocol kernel {
#   learn;          # Learn all alien routes from the kernel
    persist;        # Don't remove routes on bird shutdown
    scan time 20;       # Scan kernel routing table every 20 seconds
#   import none;        # Default is import all
    export all;     # Default is export none
#   kernel table 5;     # Kernel table to synchronize with (default: main)
}

# This pseudo-protocol watches all interface up/down events.
protocol device {
    scan time 10;       # Scan interfaces every 10 seconds
}

protocol bgp bgp_vultr_v6_1 {
    description "Vultr Bogons RS1 v6";
    #import filter vultr_bogons_import;
    #export filter vultr_bogons_export;
    import none;
    export all;
    local as 139205;
    graceful restart on;
    multihop 255;
    password "DWHD.ORG";
    neighbor 2001:19f0:ffff::1 as 64515;
    source address 2001:19f0:7001:35a0:5400:2ff:fe24:a37c;
}

# Static routes (again, there can be multiple instances, so that you
# can disable/enable various groups of static routes on the fly).
protocol static {
#   disabled;       # Disable by default
#   table testable;     # Connect to a non-default table
#   preference 1000;    # Default preference of routes
#   debug { states, routes, filters, interfaces, events, packets };
#   debug all;
#   route 0.0.0.0/0 via 198.51.100.13;
#   route 198.51.100.0/25 unreachable;
#   route 10.0.0.0/8 unreachable;
#   route 10.1.1.0:255.255.255.0 via 198.51.100.3;
#   route 10.1.2.0:255.255.255.0 via 198.51.100.3;
#   route 10.1.3.0:255.255.255.0 via 198.51.100.4;
#   route 10.2.0.0/24 via "arc0";
    route 2404:eb40:1::/48 via 2001:19f0:7001:35a0:5400:2ff:fe24:a37c;
    route 2404:eb40:2::/48 via 2001:19f0:7001:35a0:5400:2ff:fe24:a37c;
    route 2404:eb40:3::/48 via 2001:19f0:7001:35a0:5400:2ff:fe24:a37c;
    route 2404:eb40:100::/48 via 2001:19f0:7001:35a0:5400:2ff:fe24:a37c;
}
lookback

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: