File tree 11 files changed +470
-7
lines changed
files/etc/systemd/network
templates/etc/bird/bird.conf.d
11 files changed +470
-7
lines changed Original file line number Diff line number Diff line change 1
1
node . reverse_merge! ( {
2
-
2
+ ebgp_router : {
3
+ id : '192.50.220.191' ,
4
+ as : 64777 ,
5
+ local : {
6
+ v4 : '192.50.220.191' ,
7
+ v6 : '2001:df0:8500:a717::1' ,
8
+ } ,
9
+ } ,
3
10
} )
4
11
5
12
# シリアルで入れないのはデバッグに不便なので入れるようにする。
45
52
end
46
53
47
54
%w(
48
- /etc/systemd/network/11-enp11s0f0.network
49
- /etc/systemd/network/12-enp11s0f1.network
55
+ 01-lo.network
56
+ 11-enp11s0f0.network
57
+ 12-enp11s0f1.network
58
+ 31-t_yume.netdev
59
+ 32-t_yume.network
50
60
) . each do |f |
51
- remote_file f do
61
+ remote_file "/etc/systemd/network/ #{ f } " do
52
62
owner 'root'
53
63
group 'root'
54
64
mode '644'
55
65
notifies :restart , 'service[systemd-networkd]'
56
66
end
57
67
end
58
68
69
+ include_role 'ebgp-router'
70
+
71
+ %w(
72
+ t_yume.conf
73
+ static.conf
74
+ ) . each do |t |
75
+ template "/etc/bird/bird.conf.d/#{ t } " do
76
+ owner 'root'
77
+ group 'root'
78
+ mode '644'
79
+ notifies :restart , 'service[bird]'
80
+ end
81
+ end
82
+
83
+ service 'bird' do
84
+ action [ :enable , :start ]
85
+ end
86
+
59
87
include_cookbook 'sshd'
60
88
61
89
%w(
62
90
bind9-dnsutils
91
+ tcpdump
92
+ htop
93
+ mtr
63
94
) . each do |p |
64
95
package p
65
96
end
Original file line number Diff line number Diff line change 2
2
Name=lo
3
3
4
4
[Network]
5
- Address=192.50.220.185/32
5
+ Address=192.50.220.191/32
6
+ Scope=global
6
7
8
+ [Network]
9
+ Address=2001:df0:8500:a717::1/64
Original file line number Diff line number Diff line change @@ -7,5 +7,10 @@ Name=enp11s0f0
7
7
Address=240b:250:8020:d00::17/64
8
8
IPv6AcceptRA=true
9
9
10
- [Route]
10
+ Tunnel=t_yume
11
11
12
+ [Route]
13
+ Destination=::/0
14
+ Gateway=fe80::a
15
+ Table=100
16
+ Metric=2000
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ Name=enp11s0f1
6
6
Address=10.8.30.17/24
7
7
DNS=10.8.192.42
8
8
DNS=10.8.208.42
9
- # Address=2001:df0:8500:a7a3::17/64
10
9
11
10
IPv6AcceptRA=false
12
11
Original file line number Diff line number Diff line change
1
+ [NetDev]
2
+ Name=t_yume
3
+ Kind=ip6tnl
4
+
5
+ [Tunnel]
6
+ Local=240b:250:8020:d00::17
7
+ Remote=2001:f74:9800:400::eb96
8
+ Mode=any
9
+ EncapsulationLimit=none
Original file line number Diff line number Diff line change
1
+ [Match]
2
+ Name=t_yume
3
+
4
+ [Network]
5
+ DHCP=off
6
+ IPv6AcceptRA=no
7
+ IPForward=yes
8
+
9
+ [Address]
10
+ Address=2001:0df0:8500:0022::120:13/128
11
+ Peer=2001:0df0:8500:0022::120:12/128
Original file line number Diff line number Diff line change
1
+ /*
2
+ protocol static static6 {
3
+ route 240b:250:8020:d00::/64 via 240b:250:8020:d00::1;
4
+ igp table t6_igp;
5
+ ipv6 {
6
+ table t6_bgp;
7
+ import filter
8
+ {
9
+ bgp_community.add((AS_SELF, C_CTL_ASSUME_BGP));
10
+ accept;
11
+ };
12
+ };
13
+ }
14
+ */
Original file line number Diff line number Diff line change
1
+ protocol static static_yume {
2
+ route 2001:f74:9800:400::eb96/128 via fe80::212:e2ff:fe70:b200%enp11s0f0;
3
+ igp table t6_igp;
4
+ ipv6 {
5
+ table t6_bgp;
6
+ import filter
7
+ {
8
+ bgp_community.add((AS_SELF, C_CTL_ASSUME_BGP));
9
+ accept;
10
+ };
11
+ };
12
+ }
13
+
14
+ protocol bgp bgp_t_yume
15
+ {
16
+ local 2001:df0:8500:22::120:13 as 64777;
17
+ neighbor 2001:df0:8500:22::120:12 as 59128;
18
+
19
+ password "<%= node[:secrets].fetch(:bgp_secret_yume) %>";
20
+
21
+ hold time 30;
22
+ startup hold time 90;
23
+ keepalive time 6;
24
+ connect retry time 5;
25
+ connect delay time 5;
26
+ error wait time 30, 30;
27
+ error forget time 30;
28
+ default bgp_local_pref 200;
29
+
30
+ ipv4 {
31
+ table t4_bgp;
32
+ igp table t4_igp;
33
+ preference 200;
34
+ next hop address 2001:df0:8500:22::120:13;
35
+ extended next hop on;
36
+
37
+ import filter
38
+ {
39
+ accept;
40
+ filter_accept_default_route();
41
+ reject;
42
+ };
43
+
44
+ export filter
45
+ {
46
+ if ( net ~ [ 192.50.220.191/32 ]) then accept;
47
+ reject;
48
+ };
49
+ };
50
+
51
+
52
+ ipv6 {
53
+ table t6_bgp;
54
+ igp table t6_igp;
55
+ preference 200;
56
+ next hop self on;
57
+
58
+ import filter
59
+ {
60
+ accept;
61
+ filter_accept_default_route();
62
+ reject;
63
+ };
64
+
65
+ export filter
66
+ {
67
+ if ( net ~ [ 2001:0df0:8500:a717::/64+ ]) then accept;
68
+ reject;
69
+ };
70
+ };
71
+ }
Original file line number Diff line number Diff line change
1
+ package 'bird2'
2
+
3
+ directory '/etc/bird' do
4
+ owner 'root'
5
+ group 'root'
6
+ mode '0755'
7
+ end
8
+
9
+ directory '/etc/bird/bird.conf.d' do
10
+ owner 'root'
11
+ group 'root'
12
+ mode '0755'
13
+ end
14
+
15
+ template '/etc/bird/bird.conf' do
16
+ owner 'root'
17
+ group 'root'
18
+ mode '644'
19
+ notifies :restart , 'service[bird]'
20
+ end
You can’t perform that action at this time.
0 commit comments