Skip to content

Commit 6d716cc

Browse files
committed
feat(specs): Add specs test and examples for ethernet layer3 subinterface
1 parent bf4aafa commit 6d716cc

File tree

3 files changed

+4254
-0
lines changed

3 files changed

+4254
-0
lines changed
Lines changed: 325 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,325 @@
1+
resource "panos_template" "example" {
2+
location = { panorama = {} }
3+
name = "example-tmpl"
4+
}
5+
6+
resource "panos_ethernet_interface" "parent" {
7+
location = {
8+
template = {
9+
vsys = "vsys1"
10+
name = panos_template.example.name
11+
}
12+
}
13+
name = "ethernet1/1"
14+
layer3 = {}
15+
}
16+
17+
resource "panos_ethernet_layer3_subinterface" "example1" {
18+
location = {
19+
template = {
20+
vsys = "vsys1"
21+
name = panos_template.example.name
22+
}
23+
}
24+
parent = panos_ethernet_interface.parent.name
25+
name = "ethernet1/1.1"
26+
tag = 1
27+
comment = "Basic subinterface"
28+
netflow_profile = "NetflowProfile1"
29+
mtu = 1500
30+
adjust_tcp_mss = { enable = true, ipv4_mss_adjustment = 1300, ipv6_mss_adjustment = 1300 }
31+
arp = [{ name = "192.168.0.1", hw_address = "00:1a:2b:3c:4d:5e" }]
32+
bonjour = { enable = true, group_id = 5, ttl_check = true }
33+
decrypt_forward = true
34+
df_ignore = true
35+
ndp_proxy = { enabled = true, address = [{ name = "10.0.0.1", negate = false }] }
36+
ip = [{ name = "192.168.1.1", sdwan_gateway = "192.168.1.1" }]
37+
}
38+
39+
resource "panos_ethernet_layer3_subinterface" "example2" {
40+
location = {
41+
template = {
42+
vsys = "vsys1"
43+
name = panos_template.example.name
44+
}
45+
}
46+
parent = panos_ethernet_interface.parent.name
47+
name = "ethernet1/1.2"
48+
tag = 2
49+
comment = "IPv6 GUA subinterface"
50+
ipv6 = {
51+
enabled = true
52+
inherited = {
53+
assign_addr = [
54+
{
55+
name = "gua_config"
56+
type = {
57+
gua = {
58+
enable_on_interface = true
59+
prefix_pool = "my-gua-pool"
60+
}
61+
}
62+
}
63+
]
64+
}
65+
}
66+
}
67+
68+
resource "panos_ethernet_layer3_subinterface" "example3" {
69+
location = {
70+
template = {
71+
vsys = "vsys1"
72+
name = panos_template.example.name
73+
}
74+
}
75+
parent = panos_ethernet_interface.parent.name
76+
name = "ethernet1/1.3"
77+
tag = 3
78+
comment = "IPv6 ULA subinterface"
79+
ipv6 = {
80+
enabled = true
81+
inherited = {
82+
assign_addr = [
83+
{
84+
name = "ula_config"
85+
type = {
86+
ula = {
87+
enable_on_interface = true
88+
address = "fd00:1234:5678::/48"
89+
}
90+
}
91+
}
92+
]
93+
}
94+
}
95+
}
96+
97+
resource "panos_ethernet_layer3_subinterface" "example4" {
98+
location = {
99+
template = {
100+
vsys = "vsys1"
101+
name = panos_template.example.name
102+
}
103+
}
104+
parent = panos_ethernet_interface.parent.name
105+
name = "ethernet1/1.4"
106+
tag = 4
107+
comment = "SDWAN DDNS subinterface"
108+
sdwan_link_settings = {
109+
enable = true
110+
sdwan_interface_profile = "SdwanProfile1"
111+
upstream_nat = {
112+
enable = true
113+
ddns = {}
114+
}
115+
}
116+
}
117+
118+
resource "panos_ethernet_layer3_subinterface" "example5" {
119+
location = {
120+
template = {
121+
vsys = "vsys1"
122+
name = panos_template.example.name
123+
}
124+
}
125+
parent = panos_ethernet_interface.parent.name
126+
name = "ethernet1/1.5"
127+
tag = 5
128+
comment = "SDWAN Static IP FQDN subinterface"
129+
sdwan_link_settings = {
130+
enable = true
131+
sdwan_interface_profile = "SdwanProfile1"
132+
upstream_nat = {
133+
enable = true
134+
static_ip = {
135+
fqdn = "example.com"
136+
}
137+
}
138+
}
139+
}
140+
141+
resource "panos_ethernet_layer3_subinterface" "example6" {
142+
location = {
143+
template = {
144+
vsys = "vsys1"
145+
name = panos_template.example.name
146+
}
147+
}
148+
parent = panos_ethernet_interface.parent.name
149+
name = "ethernet1/1.6"
150+
tag = 6
151+
comment = "SDWAN Static IP Address subinterface"
152+
sdwan_link_settings = {
153+
enable = true
154+
sdwan_interface_profile = "SdwanProfile1"
155+
upstream_nat = {
156+
enable = true
157+
static_ip = {
158+
ip_address = "203.0.113.1"
159+
}
160+
}
161+
}
162+
}
163+
164+
resource "panos_ethernet_layer3_subinterface" "example7" {
165+
location = {
166+
template = {
167+
vsys = "vsys1"
168+
name = panos_template.example.name
169+
}
170+
}
171+
parent = panos_ethernet_interface.parent.name
172+
name = "ethernet1/1.7"
173+
tag = 7
174+
comment = "DHCP Client subinterface"
175+
dhcp_client = {
176+
create_default_route = true
177+
default_route_metric = 10
178+
enable = true
179+
send_hostname = {
180+
enable = true
181+
hostname = "dhcp-client-hostname"
182+
}
183+
}
184+
interface_management_profile = "dhcp-client-profile"
185+
ipv6 = { enabled = false }
186+
sdwan_link_settings = { enable = false }
187+
}
188+
189+
resource "panos_ethernet_layer3_subinterface" "example8" {
190+
location = {
191+
template = {
192+
vsys = "vsys1"
193+
name = panos_template.example.name
194+
}
195+
}
196+
parent = panos_ethernet_interface.parent.name
197+
name = "ethernet1/1.8"
198+
tag = 8
199+
comment = "IPv6 DHCP Client subinterface"
200+
ipv6 = {
201+
enabled = true
202+
dhcp_client = {
203+
accept_ra_route = true
204+
default_route_metric = 10
205+
enable = true
206+
neighbor_discovery = {
207+
dad_attempts = 1
208+
enable_dad = true
209+
enable_ndp_monitor = true
210+
ns_interval = 1000
211+
reachable_time = 30000
212+
}
213+
preference = "high"
214+
prefix_delegation = {
215+
enable = {
216+
yes = {
217+
pfx_pool_name = "prefix-pool-1"
218+
prefix_len = 64
219+
prefix_len_hint = true
220+
}
221+
}
222+
}
223+
v6_options = {
224+
duid_type = "duid-type-llt"
225+
enable = {
226+
yes = {
227+
non_temp_addr = true
228+
temp_addr = false
229+
}
230+
}
231+
rapid_commit = true
232+
support_srvr_reconfig = true
233+
}
234+
}
235+
}
236+
}
237+
238+
resource "panos_ethernet_layer3_subinterface" "example9" {
239+
location = {
240+
template = {
241+
vsys = "vsys1"
242+
name = panos_template.example.name
243+
}
244+
}
245+
parent = panos_ethernet_interface.parent.name
246+
name = "ethernet1/1.9"
247+
tag = 9
248+
comment = "IPv6 Neighbor Discovery subinterface"
249+
ipv6 = {
250+
enabled = true
251+
neighbor_discovery = {
252+
dad_attempts = 1
253+
enable_dad = true
254+
enable_ndp_monitor = true
255+
ns_interval = 1000
256+
reachable_time = 30000
257+
neighbor = [
258+
{
259+
name = "2001:DB8::1/128"
260+
hw_address = "00:1a:2b:3c:4d:5e"
261+
}
262+
]
263+
router_advertisement = {
264+
enable = true
265+
enable_consistency_check = true
266+
hop_limit = "64"
267+
lifetime = 1800
268+
link_mtu = "1500"
269+
managed_flag = true
270+
max_interval = 600
271+
min_interval = 200
272+
other_flag = true
273+
reachable_time = "0"
274+
retransmission_timer = "0"
275+
router_preference = "Medium"
276+
dns_support = {
277+
enable = true
278+
server = [
279+
{
280+
name = "2001:DB8::1/128"
281+
lifetime = 1200
282+
}
283+
]
284+
suffix = [
285+
{
286+
name = "suffix1"
287+
lifetime = 1200
288+
}
289+
]
290+
}
291+
}
292+
}
293+
}
294+
}
295+
296+
resource "panos_ethernet_layer3_subinterface" "example10" {
297+
location = {
298+
template = {
299+
vsys = "vsys1"
300+
name = panos_template.example.name
301+
}
302+
}
303+
parent = panos_ethernet_interface.parent.name
304+
name = "ethernet1/1.10"
305+
tag = 10
306+
comment = "PPPoE subinterface"
307+
pppoe = {
308+
access_concentrator = "ac-1"
309+
authentication = "auto"
310+
create_default_route = true
311+
default_route_metric = 10
312+
enable = true
313+
passive = {
314+
enable = true
315+
}
316+
password = "pppoe-password"
317+
service = "pppoe-service"
318+
static_address = {
319+
ip = "192.168.2.1"
320+
}
321+
username = "pppoe-user"
322+
}
323+
ipv6 = { enabled = false }
324+
sdwan_link_settings = { enable = false }
325+
}

0 commit comments

Comments
 (0)