Skip to content

Commit 0c1d502

Browse files
authored
Merge pull request #252 from microsoft/netplan
Add netplan-based network topology encoding
2 parents 48eb28a + 0ba0cc6 commit 0c1d502

File tree

14 files changed

+69
-46
lines changed

14 files changed

+69
-46
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ if (WERROR)
161161
add_compile_options(-Werror)
162162
endif()
163163

164+
add_subdirectory(config)
164165
add_subdirectory(packaging)
165166
add_subdirectory(src)
166167

config/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
add_subdirectory(linux)

config/linux/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
add_subdirectory(network)

config/linux/network/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
add_subdirectory(cloud)
3+
add_subdirectory(netplan)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
network: { config: disabled }
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
install(
3+
FILES
4+
${CMAKE_CURRENT_LIST_DIR}/99-disable-network-config.cfg
5+
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/cloud/cloud.cfg.d
6+
COMPONENT network-config
7+
)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#
2+
# This plan defines a network topology where a set of interfaces provide gateway services to wireless network clients.
3+
#
4+
# Netplan YAML reference: https://netplan.readthedocs.io/en/stable/netplan-yaml/
5+
#
6+
# Instructions:
7+
# 1. Identify all interfaces, ethernet or otherwise, that provide network services such as DHCP, DNS, etc. to wireless
8+
# network clients. This will typically be, but is not limited to, a single ethernet interface.
9+
# 2. For each interface identified above:
10+
# a. Add a network interface definition entry according to its type ('ethernets', 'vlans', etc.) which disables all
11+
# IP addressing. See the netplan yaml reference URL above for complete options if necessary.
12+
# b. Add the interface name to the 'interfaces' property of the brgateway0 bridge definition to make the interface
13+
# available to all bridge slaves.
14+
# 3. Re-generate ("render") the plan using 'sudo netplan generate'.
15+
# 4. Optionally validate the generated configuration using 'sudo netplan try'.
16+
# 5. Apply the generated configuration using 'sudo netplan apply'.
17+
#
18+
# The default template describes a plan where a single ethernet network interface 'eno2' provides all gateway services.
19+
#
20+
21+
network:
22+
version: 2
23+
renderer: networkd
24+
ethernets:
25+
eno2: # ** Change this to the interface that provides gateway network services (DHCP, DNS, etc.). **
26+
# Disable DHCP on all interfaces that will be part of the virtual bridge interface.
27+
dhcp4: no
28+
dhcp6: no
29+
bridges:
30+
# Define a bridge that will act as a gateway to wireless clients.
31+
brgateway0:
32+
# Configure the bridge to obtain its IP address using DHCP.
33+
dhcp4: yes
34+
# Include interfaces that provide the gateway services to wireless clients. DO NOT ADD wireless interfaces here.
35+
interfaces:
36+
- eno2
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
install(
3+
FILES
4+
${CMAKE_CURRENT_LIST_DIR}/10-network-netremote-all.yaml
5+
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/netplan
6+
COMPONENT network-config
7+
)

packaging/deb/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ set(CPACK_COMPONENTS_ALL
1313
server
1414
hostapd
1515
dev
16+
network-config
1617
)
1718

1819
include(CPack)

src/linux/external/hostap/systemd/CMakeLists.txt

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,8 @@ configure_file(
55
)
66

77
configure_file(
8-
${CMAKE_CURRENT_SOURCE_DIR}/[email protected]
9-
${CMAKE_CURRENT_BINARY_DIR}/[email protected]
10-
@ONLY
11-
)
12-
13-
configure_file(
14-
${CMAKE_CURRENT_SOURCE_DIR}/[email protected]
15-
${CMAKE_CURRENT_BINARY_DIR}/[email protected]
8+
${CMAKE_CURRENT_SOURCE_DIR}/[email protected]
9+
${CMAKE_CURRENT_BINARY_DIR}/[email protected]
1610
@ONLY
1711
)
1812

@@ -37,26 +31,14 @@ install(
3731

3832
install(
3933
FILES
40-
${CMAKE_CURRENT_BINARY_DIR}/[email protected]
41-
CONFIGURATIONS Release
42-
DESTINATION ${CMAKE_INSTALL_LIBDIR}/systemd/system
43-
44-
COMPONENT hostapd
45-
)
46-
47-
install(
48-
FILES
49-
${CMAKE_CURRENT_BINARY_DIR}/[email protected]
50-
CONFIGURATIONS Debug RelWithDebInfo MinSizeRel
34+
${CMAKE_CURRENT_BINARY_DIR}/[email protected]
5135
DESTINATION ${CMAKE_INSTALL_LIBDIR}/systemd/system
52-
5336
COMPONENT hostapd
5437
)
5538

5639
install(
5740
FILES
5841
${CMAKE_CURRENT_BINARY_DIR}/[email protected]
59-
CONFIGURATIONS Debug RelWithDebInfo MinSizeRel
6042
DESTINATION ${CMAKE_INSTALL_LIBDIR}/systemd/system
6143
COMPONENT hostapd
6244
)

0 commit comments

Comments
 (0)