]> git.proxmox.com Git - pve-common.git/blame - test/etc_network_interfaces/t.create_network.pl
Inotify : add check_bond
[pve-common.git] / test / etc_network_interfaces / t.create_network.pl
CommitLineData
c7c4208a
WB
1save('proc_net_dev', <<'/proc/net/dev');
2eth0:
3eth1:
4/proc/net/dev
5
6r(load('brbase'));
7
8my $ip = '192.168.0.2';
9my $nm = '255.255.255.0';
10my $gw = '192.168.0.1';
95aa8788
AD
11my $svcnodeip = '239.192.105.237';
12my $physdev = 'eth0';
13my $remoteip1 = '192.168.0.3';
14my $remoteip2 = '192.168.0.4';
15
c7c4208a
WB
16
17$config->{ifaces}->{eth1} = {
18 type => 'eth',
19 method => 'static',
20 address => $ip,
21 netmask => $nm,
22 gateway => $gw,
23 families => ['inet'],
24 autostart => 1
25};
26
0115696f
AD
27$config->{ifaces}->{eth2} = {
28 type => 'eth',
29 method => 'manual',
30 families => ['inet'],
31 autostart => 1
32};
33
34$config->{ifaces}->{eth3} = {
35 type => 'eth',
36 method => 'manual',
37 families => ['inet'],
38 autostart => 1
39};
40
41$config->{ifaces}->{bond0} = {
42 type => 'bond',
43 slaves => 'eth2 eth3',
44 bond_mode => '802.3ad',
45 bond_xmit_hash_policy => 'layer3+4',
46 bond_miimon => 100,
47 method => 'manual',
48 families => ['inet'],
49 autostart => 1
50};
51
9a052564
AD
52$config->{ifaces}->{vmbr1} = {
53 type => 'bridge',
54 method => 'manual',
55 families => ['inet'],
56 bridge_stp => off,
57 bridge_fd => 0,
58 bridge_ports => vxlan1,
59 bridge_vlan_aware => yes,
60 autostart => 1
61};
62
63
64$config->{ifaces}->{vmbr2} = {
65 type => 'bridge',
66 method => 'manual',
67 families => ['inet'],
68 bridge_stp => off,
69 bridge_fd => 0,
70 bridge_ports => vxlan2,
71 autostart => 1
72};
73
74$config->{ifaces}->{vmbr3} = {
75 type => 'bridge',
76 method => 'manual',
77 families => ['inet'],
78 bridge_stp => off,
79 bridge_fd => 0,
80 bridge_ports => vxlan3,
81 bridge_vlan_aware => yes,
82 bridge_vids => '2-10',
83 autostart => 1
84};
85
95aa8788
AD
86$config->{ifaces}->{vxlan1} = {
87 type => 'vxlan',
88 method => 'manual',
89 families => ['inet'],
90 'vxlan-id' => 1,
91 'vxlan-svcnodeip' => $svcnodeip,
92 'vxlan-physdev' => $physdev,
93 autostart => 1
94};
95
96$config->{ifaces}->{vxlan2} = {
97 type => 'vxlan',
98 method => 'manual',
99 families => ['inet'],
100 'vxlan-id' => 2,
101 'vxlan-local-tunnelip' => $ip,
9a052564
AD
102 'bridge-learning' => 'off',
103 'bridge-arp-nd-suppress' => 'on',
104 'bridge-unicast-flood' => 'off',
105 'bridge-multicast-flood' => 'off',
95aa8788
AD
106 autostart => 1
107};
108
109$config->{ifaces}->{vxlan3} = {
110 type => 'vxlan',
111 method => 'manual',
112 families => ['inet'],
113 'vxlan-id' => 3,
114 'vxlan-remoteip' => [$remoteip1, $remoteip2],
9a052564 115 'bridge-access' => 3,
95aa8788
AD
116 autostart => 1
117};
118
119
c7c4208a
WB
120expect load('loopback') . <<"CHECK";
121source-directory interfaces.d
122
123iface eth0 inet manual
124
125auto eth1
126iface eth1 inet static
127 address $ip
128 netmask $nm
129 gateway $gw
130
0115696f
AD
131auto eth2
132iface eth2 inet manual
133
134auto eth3
135iface eth3 inet manual
136
137auto bond0
138iface bond0 inet manual
139 bond-slaves eth2 eth3
140 bond-miimon 100
141 bond-mode 802.3ad
142 bond-xmit-hash-policy layer3+4
143
c7c4208a
WB
144auto vmbr0
145iface vmbr0 inet static
146 address 10.0.0.2
147 netmask 255.255.255.0
148 gateway 10.0.0.1
1accc6da
AD
149 bridge-ports eth0
150 bridge-stp off
151 bridge-fd 0
c7c4208a 152
9a052564
AD
153auto vmbr1
154iface vmbr1 inet manual
155 bridge-ports vxlan1
156 bridge-stp off
157 bridge-fd 0
158 bridge-vlan-aware yes
159 bridge-vids 2-4094
160
161auto vmbr2
162iface vmbr2 inet manual
163 bridge-ports vxlan2
164 bridge-stp off
165 bridge-fd 0
166
167auto vmbr3
168iface vmbr3 inet manual
169 bridge-ports vxlan3
170 bridge-stp off
171 bridge-fd 0
172 bridge-vlan-aware yes
173 bridge-vids 2-10
174
95aa8788
AD
175auto vxlan1
176iface vxlan1 inet manual
177 vxlan-id 1
178 vxlan-svcnodeip $svcnodeip
179 vxlan-physdev $physdev
180
181auto vxlan2
182iface vxlan2 inet manual
183 vxlan-id 2
184 vxlan-local-tunnelip $ip
9a052564
AD
185 bridge-arp-nd-suppress on
186 bridge-learning off
187 bridge-multicast-flood off
188 bridge-unicast-flood off
95aa8788
AD
189
190auto vxlan3
191iface vxlan3 inet manual
192 vxlan-id 3
193 vxlan-remoteip $remoteip1
194 vxlan-remoteip $remoteip2
9a052564 195 bridge-access 3
95aa8788 196
c7c4208a
WB
197CHECK
198
199save('if', w());
200r(load('if'));
201expect load('if');
202
203r(load('brbase'));
204
205my $ip = 'fc05::2';
206my $nm = '112';
207my $gw = 'fc05::1';
208
209$config->{ifaces}->{eth1} = {
210 type => 'eth',
211 method6 => 'static',
212 address6 => $ip,
213 netmask6 => $nm,
214 gateway6 => $gw,
215 families => ['inet6'],
216 autostart => 1
217};
218
219
220expect load('loopback') . <<"CHECK";
221source-directory interfaces.d
222
223iface eth0 inet manual
224
225auto eth1
226iface eth1 inet6 static
227 address $ip
228 netmask $nm
229 gateway $gw
230
231auto vmbr0
232iface vmbr0 inet static
233 address 10.0.0.2
234 netmask 255.255.255.0
235 gateway 10.0.0.1
1accc6da
AD
236 bridge-ports eth0
237 bridge-stp off
238 bridge-fd 0
c7c4208a
WB
239
240CHECK
241
242save('if', w());
243r(load('if'));
244expect load('if');
245
2461;