OpenWrt Forum Archive

Topic: Suggestion for S40network

The content of this topic has been archived on 4 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Feature suggestion: to be able to configure DMZ port(s) but not have to mess with the startup script, have an nvram variable which lists the interface names to be brought up. e.g.

# nvram set interfaces="lan wan dmz"

Here's a patch which implements this.

--- S40network.orig     Fri Jan 20 13:35:48 2006
+++ S40network  Fri Jan 20 13:35:39 2006
@@ -1,9 +1,8 @@
 #!/bin/sh
 case "$1" in
   start|restart)
-    ifup lan
-    ifup wan
-    ifup wifi
+    ports=$(nvram get interfaces)
+    for i in ${ports:-lan wan wifi}; do ifup $i; done
     wifi up

     for route in $(nvram get static_route); do {

On a completely different point: I set up my OpenWRT (RC4) box picking up IP addresses via DHCP on two separate networks, and I found myself with two default routes, which was a bit of a mess. Once I'd manually removed them both a put a single defaultroute pointing the right way, it was fine. Is there a way to configure a port as DHCP client but not pick up defaultroute and/or nameservers?

Cheers, Brian.

candlerb

This is a good idea - so good in fact that it has already been implemented in the upcoming Kamikaze version of OpenWRT.

Check out https://dev.openwrt.org/file/trunk/open … net/10-net

In Kamikaze the network init is configured via hotplug.  There are two NVRAM vars that control which interfaces get brought up.  They are "ifnames" and "unused_ifnames".  In the script you'll notice that "lan" "wan" and "wifi" are hard-coded to always be brought up in addition to any interfaces specified in "ifnames".

The discussion might have continued from here.