#!/bin/sh export DATE="14.9.2008";SCRIPT=${0#/rom} export TITLE="Admin: LAN" . ${SCRIPT%/*}/cgi-bin-pre.sh cat<Admin: LAN EOF if [ "$REQUEST_METHOD" = "POST" ]; then read QUERY_STRING fi if [ -z "$QUERY_STRING" ]; then #Speedups lan_proto="$(nvram get lan_proto)" lan_ipaddr=$(nvram get lan_ipaddr) lan_netmask=$(nvram get lan_netmask) dhcp_start=$(nvram get dhcp_start) dhcp_num=$(nvram get dhcp_num) test -z "$dhcp_num" && dhcp_num=4 wifi_ipaddr=$(nvram get wifi_ipaddr) wifi_netmask=$(nvram get wifi_netmask) ff_lan_proto=$(nvram get ff_lan_proto) test -z "$ff_lan_proto" && lan_proto=static case $lan_proto in dhcp|disabled|olsr) ;; *)lan_proto=static ;; esac cat<
LAN Protocol:
LAN IP:
LAN Netmask:
LAN Default Route:
Static Routes:
Disable NAT:
Disable Firewall:
EOF if [ "$(test -n "$lan_ipaddr" && ipcalc -n $lan_ipaddr $wifi_netmask|cut -d'=' -f2)" = "$(test -n "$wifi_ipaddr" && ipcalc -n $wifi_ipaddr $wifi_netmask|cut -d'=' -f2)" ]; then cat<Note: The firewall function between WLAN and LAN is not active, because the LAN IP address ($lan_ipaddr) is part of the WLAN network ($wifi_ipaddr/$wifi_netmask). EOF fi cat<
DHCP Start IP: $(test -n "$lan_ipaddr" && ipcalc -n $lan_ipaddr $lan_netmask|cut -d'=' -f2|cut -d'.' -f1-3).
DHCP Number of Users: (DHCP off with "0")
DHCP Lease Time: seconds
 
   

Tip: These settings influence the configuration, which is sent to wired clients via DHCP. To ensure a convenient network access, you should enter the Host Name and the internal Domain (-> System).

EOF else IFS=\&;set ${QUERY_STRING%%[^%&=+-:@-_a-z~]*};unset IFS;eval $* DIRTY= if [ -n "$post_lan" ]; then test -n "$lan_proto" && ff_lan_proto=1 for V in ff_lan_proto lan_proto lan_ipaddr lan_netmask lan_gateway static_route ff_nonat fw_disable dhcp_start dhcp_num dhcp_lease; do eval "C=\$$V" C=$(httpd -d "$C") if [ "$C" != "$(nvram get $V)" ]; then DIRTY=1 nvram set $V="$C" fi done if checkbridge; then DIRTY=1 fi fi if [ -n "$DIRTY" ]; then nvram commit>/dev/null 2>&1 cat< The changed settings are committed. The settings are active after the next Restart. EOF else cat< No settings are changed. EOF fi fi . ${SCRIPT%/*}/cgi-bin-post.sh