Skip to content

Commit 0605165

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 f541902 commit 0605165

File tree

1 file changed

+121
-0
lines changed

1 file changed

+121
-0
lines changed
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# This is an example for defining network configuration data that
2+
# can be applied automatically when the device boots.
3+
#
4+
networking:
5+
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:
38+
status: true
39+
ipv4_autoconf:
40+
status: true
41+
42+
# Example of another interface selected by its device
43+
- &device-interface
44+
device_name: ETH_DEVICE
45+
set_name: my-eth1
46+
flags:
47+
- NET_IF_NO_AUTO_START
48+
ipv4:
49+
status: true
50+
ipv4_addresses:
51+
- 192.168.1.2/24
52+
ipv4_multicast_addresses:
53+
- 234.0.0.10
54+
gateway: 192.168.110.1
55+
time_to_live: 10
56+
multicast_time_to_live: 0
57+
dhcpv4:
58+
status: true
59+
dhcpv4_server:
60+
status: true
61+
base_address: 192.168.1.100
62+
63+
# Example of virtual interface tied to the first one
64+
- name: virt0
65+
set_name: virt0
66+
bind_to: *device-interface
67+
ipv6:
68+
status: false
69+
ipv6_addresses:
70+
- 2001:db8:111::2
71+
ipv4:
72+
status: false
73+
74+
# Example of VLAN interface that attaches to eth0
75+
- &vlan-interface
76+
set_name: vlan0
77+
bind_to: *main-interface
78+
vlan:
79+
status: true
80+
tag: 1234
81+
ipv4:
82+
status: true
83+
dhcpv4:
84+
status: true
85+
86+
# The interface IPv4 configuration could be set to disabled
87+
# in which case its IPv4 configuration is skipped
88+
- name: eth1
89+
set_name: my-eth2
90+
flags:
91+
- NET_IF_NO_AUTO_START
92+
ipv4:
93+
status: false
94+
ipv4_addresses:
95+
- 192.168.1.2/24
96+
ipv4_multicast_addresses:
97+
- 234.0.0.10
98+
gateway: 192.168.110.1
99+
time_to_live: 10
100+
multicast_time_to_live: 0
101+
dhcpv4_server:
102+
status: true
103+
base_address: 192.168.2.1
104+
105+
ieee_802_15_4:
106+
status: true
107+
pan_id: 0xabcd
108+
channel: 26
109+
tx_power: 1
110+
security_key: [0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9,
111+
0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf]
112+
security_key_mode: 0
113+
security_level: 1
114+
ack_required: true
115+
bind_to: *device-interface
116+
117+
sntp:
118+
status: true
119+
server: sntp.foo.bar
120+
timeout: 30
121+
bind_to: *vlan-interface

0 commit comments

Comments
 (0)