Skip to content

Commit a1aa2c7

Browse files
committed
net: config: Example yaml configuration file
Example networking yaml configuration file. This contains more complex network setup that can be used to see what can be done. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 3d837f2 commit a1aa2c7

File tree

1 file changed

+117
-0
lines changed

1 file changed

+117
-0
lines changed
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# This is an example for defining network configuration data that
2+
# can be applied automatically when the device boots.
3+
#
4+
net_init_config:
5+
network_interfaces:
6+
# Example of one interface selected by its name
7+
- &main-interface
8+
name: eth0
9+
set_name: my-eth0
10+
set_default: true
11+
ipv6:
12+
status: true
13+
ipv6_addresses:
14+
- 2001:db8:110::1
15+
ipv6_multicast_addresses:
16+
- ff05::114
17+
- ff15::115
18+
prefixes:
19+
- address: "2001:db8::"
20+
len: 64
21+
lifetime: 1024
22+
hop_limit: 64
23+
multicast_hop_limit: 1
24+
dhcpv6:
25+
status: true
26+
do_request_address: true
27+
do_request_prefix: false
28+
ipv4:
29+
status: true
30+
ipv4_addresses:
31+
- 192.0.2.10/24
32+
ipv4_multicast_addresses:
33+
- 234.0.0.10
34+
gateway: 192.0.2.1
35+
time_to_live: 64
36+
multicast_time_to_live: 1
37+
dhcpv4_enabled: true
38+
ipv4_autoconf_enabled: true
39+
40+
# Example of another interface selected by its device
41+
- &device-interface
42+
device_name: ETH_DEVICE
43+
set_name: my-eth1
44+
flags:
45+
- NET_IF_NO_AUTO_START
46+
ipv4:
47+
status: true
48+
ipv4_addresses:
49+
- 192.168.1.2/24
50+
ipv4_multicast_addresses:
51+
- 234.0.0.10
52+
gateway: 192.168.110.1
53+
time_to_live: 10
54+
multicast_time_to_live: 0
55+
dhcpv4_enabled: true
56+
dhcpv4_server:
57+
status: true
58+
base_address: 192.168.1.100
59+
60+
# Example of virtual interface tied to the first one
61+
- name: virt0
62+
set_name: virt0
63+
bind_to: *device-interface
64+
ipv6:
65+
status: false
66+
ipv6_addresses:
67+
- 2001:db8:111::2
68+
ipv4:
69+
status: false
70+
71+
# Example of VLAN interface that attaches to eth0
72+
- &vlan-interface
73+
set_name: vlan0
74+
bind_to: *main-interface
75+
vlan:
76+
status: true
77+
tag: 1234
78+
ipv4:
79+
status: true
80+
dhcpv4_enabled: true
81+
82+
# The interface IPv4 configuration could be set to disabled
83+
# in which case its IPv4 configuration is skipped
84+
- name: eth1
85+
set_name: my-eth2
86+
flags:
87+
- NET_IF_NO_AUTO_START
88+
ipv4:
89+
status: false
90+
ipv4_addresses:
91+
- 192.168.1.2/24
92+
ipv4_multicast_addresses:
93+
- 234.0.0.10
94+
gateway: 192.168.110.1
95+
time_to_live: 10
96+
multicast_time_to_live: 0
97+
dhcpv4_server:
98+
status: true
99+
base_address: 192.168.2.1
100+
101+
ieee_802_15_4:
102+
status: true
103+
pan_id: 0xabcd
104+
channel: 26
105+
tx_power: 1
106+
security_key: [0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9,
107+
0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf]
108+
security_key_mode: 0
109+
security_level: 1
110+
ack_required: true
111+
bind_to: *device-interface
112+
113+
sntp:
114+
status: true
115+
server: sntp.foo.bar
116+
timeout: 30
117+
bind_to: *vlan-interface

0 commit comments

Comments
 (0)