Skip to content

Commit e9aa635

Browse files
committed
installer: add disable IPv6
1 parent 7dfca88 commit e9aa635

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- support boot or/and install from USB mass storage
77
- added or changed configuration variables
88
- `release` is set to "stretch" by default
9+
- disable IPv6
910

1011
**Bugfixes:**
1112

doc/INSTALL_CUSTOM.md

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
| `ip_broadcast` | `0.0.0.0` | | Broadcast address |
8383
| `ip_gateway` | `0.0.0.0` | | Gateway address (e.g. 192.168.2.1) |
8484
| `ip_nameservers` | | | DNS nameservers (e.g. 8.8.8.8) |
85+
| `ip_ipv6` | `1` | `0`/`1` | Set to "0" to disable IPv6. |
8586

8687
## Localization
8788

scripts/opt/raspberrypi-ua-netinst/install.sh

+9
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ variables_reset() {
6262
ip_broadcast=
6363
ip_gateway=
6464
ip_nameservers=
65+
ip_ipv6=
6566
drivers_to_load=
6667
online_config=
6768
gpu_mem=
@@ -137,6 +138,7 @@ variables_set_defaults() {
137138
variable_set "ip_netmask" "0.0.0.0"
138139
variable_set "ip_broadcast" "0.0.0.0"
139140
variable_set "ip_gateway" "0.0.0.0"
141+
variable_set "ip_ipv6" "1"
140142
variable_set "hdmi_tv_res" "1080p"
141143
variable_set "hdmi_monitor_res" "1024x768"
142144
variable_set "hdmi_disable_overscan" "0"
@@ -1202,6 +1204,7 @@ echo " keyboard_layout = ${keyboard_layout}"
12021204
echo " locales = ${locales}"
12031205
echo " system_default_locale = ${system_default_locale}"
12041206
echo " wlan_country = ${wlan_country}"
1207+
echo " ip_ipv6 = ${ip_ipv6}"
12051208
echo " cmdline = ${cmdline}"
12061209
echo " drivers_to_load = ${drivers_to_load}"
12071210
echo " gpu_mem = ${gpu_mem}"
@@ -1614,6 +1617,12 @@ echo "OK"
16141617

16151618
# networking
16161619
echo -n " Configuring network settings... "
1620+
1621+
if [ "${ip_ipv6}" = "0" ]; then
1622+
mkdir -p /rootfs/etc/sysctl.d
1623+
echo "net.ipv6.conf.all.disable_ipv6 = 1" > /rootfs/etc/sysctl.d/01-disable-ipv6.conf
1624+
fi
1625+
16171626
touch /rootfs/etc/network/interfaces || fail
16181627
# lo interface may already be there, so first check for it
16191628
if ! grep -q "auto lo" /rootfs/etc/network/interfaces; then

0 commit comments

Comments
 (0)