diff --git a/files/etc/config/openwisp b/files/etc/config/openwisp
index ceefe2cdca74ec2f09072a8c41e52c0e071c3242..7cdd02238280913a5ae20a470badd87e4b57a620 100644
--- a/files/etc/config/openwisp
+++ b/files/etc/config/openwisp
@@ -1,3 +1,5 @@
 config controller 'http'
         option url 'https://openwisp.faked.org'
         option shared_secret 'fSIRdSdsqoKYhCYovE1zareJhkOKMtcL'
+        mac_interface 'br-lan'
+        management_interface 'br-lan'
diff --git a/files/etc/uci-defaults/99-custom b/files/etc/uci-defaults/99-custom
deleted file mode 100644
index ded919a7eecdd253443e2cce5fa9e8f11d8f0bbc..0000000000000000000000000000000000000000
--- a/files/etc/uci-defaults/99-custom
+++ /dev/null
@@ -1,7 +0,0 @@
-cat << "EOF" > /etc/uci-defaults/99-custom
-uci -q batch << EOI
-set network.lan.proto='dhcp'
-delete network.lan.ipaddr
-delete network.lan.netmask
-EOI
-EOF
diff --git a/files/etc/uci-defaults/99_custom b/files/etc/uci-defaults/99_custom
new file mode 100644
index 0000000000000000000000000000000000000000..fafe4a8d5a7d6c543f2cd5d11b411b81bc52de8b
--- /dev/null
+++ b/files/etc/uci-defaults/99_custom
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+uci set system.@system[0].hostname='openwrt'
+uci commit system
+
+uci batch <<-EOF >/dev/null
+  set network.lan.proto=dhcp
+  delete network.lan.ipaddr
+  delete network.lan.netmask
+  commit network
+EOF
+
+/etc/init.d/network restart
+
+exit 0