-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #252 from microsoft/netplan
Add netplan-based network topology encoding
- Loading branch information
Showing
14 changed files
with
69 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
add_subdirectory(linux) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
add_subdirectory(network) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
add_subdirectory(cloud) | ||
add_subdirectory(netplan) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
network: { config: disabled } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
install( | ||
FILES | ||
${CMAKE_CURRENT_LIST_DIR}/99-disable-network-config.cfg | ||
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/cloud/cloud.cfg.d | ||
COMPONENT network-config | ||
) |
36 changes: 36 additions & 0 deletions
36
config/linux/network/netplan/10-network-netremote-all.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# | ||
# This plan defines a network topology where a set of interfaces provide gateway services to wireless network clients. | ||
# | ||
# Netplan YAML reference: https://netplan.readthedocs.io/en/stable/netplan-yaml/ | ||
# | ||
# Instructions: | ||
# 1. Identify all interfaces, ethernet or otherwise, that provide network services such as DHCP, DNS, etc. to wireless | ||
# network clients. This will typically be, but is not limited to, a single ethernet interface. | ||
# 2. For each interface identified above: | ||
# a. Add a network interface definition entry according to its type ('ethernets', 'vlans', etc.) which disables all | ||
# IP addressing. See the netplan yaml reference URL above for complete options if necessary. | ||
# b. Add the interface name to the 'interfaces' property of the brgateway0 bridge definition to make the interface | ||
# available to all bridge slaves. | ||
# 3. Re-generate ("render") the plan using 'sudo netplan generate'. | ||
# 4. Optionally validate the generated configuration using 'sudo netplan try'. | ||
# 5. Apply the generated configuration using 'sudo netplan apply'. | ||
# | ||
# The default template describes a plan where a single ethernet network interface 'eno2' provides all gateway services. | ||
# | ||
|
||
network: | ||
version: 2 | ||
renderer: networkd | ||
ethernets: | ||
eno2: # ** Change this to the interface that provides gateway network services (DHCP, DNS, etc.). ** | ||
# Disable DHCP on all interfaces that will be part of the virtual bridge interface. | ||
dhcp4: no | ||
dhcp6: no | ||
bridges: | ||
# Define a bridge that will act as a gateway to wireless clients. | ||
brgateway0: | ||
# Configure the bridge to obtain its IP address using DHCP. | ||
dhcp4: yes | ||
# Include interfaces that provide the gateway services to wireless clients. DO NOT ADD wireless interfaces here. | ||
interfaces: | ||
- eno2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
install( | ||
FILES | ||
${CMAKE_CURRENT_LIST_DIR}/10-network-netremote-all.yaml | ||
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/netplan | ||
COMPONENT network-config | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ set(CPACK_COMPONENTS_ALL | |
server | ||
hostapd | ||
dev | ||
network-config | ||
) | ||
|
||
include(CPack) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,8 @@ configure_file( | |
) | ||
|
||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/[email protected] | ||
${CMAKE_CURRENT_BINARY_DIR}/[email protected] | ||
@ONLY | ||
) | ||
|
||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/[email protected] | ||
${CMAKE_CURRENT_BINARY_DIR}/[email protected] | ||
${CMAKE_CURRENT_SOURCE_DIR}/[email protected] | ||
${CMAKE_CURRENT_BINARY_DIR}/[email protected] | ||
@ONLY | ||
) | ||
|
||
|
@@ -37,26 +31,14 @@ install( | |
|
||
install( | ||
FILES | ||
${CMAKE_CURRENT_BINARY_DIR}/[email protected] | ||
CONFIGURATIONS Release | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/systemd/system | ||
RENAME [email protected] | ||
COMPONENT hostapd | ||
) | ||
|
||
install( | ||
FILES | ||
${CMAKE_CURRENT_BINARY_DIR}/[email protected] | ||
CONFIGURATIONS Debug RelWithDebInfo MinSizeRel | ||
${CMAKE_CURRENT_BINARY_DIR}/[email protected] | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/systemd/system | ||
RENAME [email protected] | ||
COMPONENT hostapd | ||
) | ||
|
||
install( | ||
FILES | ||
${CMAKE_CURRENT_BINARY_DIR}/[email protected] | ||
CONFIGURATIONS Debug RelWithDebInfo MinSizeRel | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/systemd/system | ||
COMPONENT hostapd | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,4 @@ | ||
# | ||
# Default hostapd configuration file. | ||
# | ||
# To use this with the provided systemd service unit template [email protected], | ||
# (eg. via 'systemctl enable hostapd@wlan0'), copy this file to | ||
# /etc/hostapd/hostapd-<interface>.conf. For example, to use it with wlan0, copy this file to | ||
# /etc/hostapd/hostapd-wlan0.conf and specify the desired SSID after the 'ssid' property below. | ||
# | ||
|
||
# Default (generated) hostapd configuration file. | ||
driver=nl80211 | ||
ctrl_interface=${CMAKE_INSTALL_FULL_RUNSTATEDIR}/hostapd | ||
ssid= | ||
|
@@ -15,6 +7,6 @@ channel=1 | |
auth_algs=3 | ||
wpa=2 | ||
wpa_passphrase=password | ||
wpa_key_mgmt=WPA-PSK WPA-PSK-SHA256 SAE | ||
wpa_pairwise=TKIP CCMP | ||
rsn_pairwise=CCMP | ||
wpa_key_mgmt=SAE | ||
rsn_pairwise=CCMP | ||
bridge=brgateway0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
[Unit] | ||
Description=Generate default hostapd configuration file | ||
AssertPathExists=@CMAKE_INSTALL_FULL_SYSCONFDIR@/hostapd/hostapd-example.conf | ||
ConditionPathExists=!@CMAKE_INSTALL_FULL_SYSCONFDIR@/hostapd/hostapd-%i.conf | ||
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=true | ||
ExecStart=/usr/bin/cp @CMAKE_INSTALL_FULL_SYSCONFDIR@/hostapd/hostapd-example.conf @CMAKE_INSTALL_FULL_SYSCONFDIR@/hostapd/hostapd-%i.conf | ||
ExecStart=/usr/bin/sed -i '/^#/d' @CMAKE_INSTALL_FULL_SYSCONFDIR@/hostapd/hostapd-%i.conf | ||
ExecStart=/usr/bin/sed -i 's/ssid=/ssid=%l-ap-%i/' @CMAKE_INSTALL_FULL_SYSCONFDIR@/hostapd/hostapd-%i.conf |
This file was deleted.
Oops, something went wrong.
File renamed without changes.