Modify

Opened 7 years ago

Closed 7 years ago

#4568 closed defect (worksforme)

ifup/ifdown script errors

Reported by: acoul <alex at ozo.com> Owned by: developers
Priority: high Milestone: Kamikaze 8.09
Component: base system Version:
Keywords: Cc:

Description

on a rb532 openwrt kamikaze trunk r14411 ifup/ifdown is not working. when issuing an ifdown eth0 I get: interface not found

changing config interface lan to config interface eth0 on /etc/config/network file fixes the problem. here is the output of: sh -x /sbin/ifdown eth0 whithout any changes on the /etc/config/network file:

+ . /etc/functions.sh
+ alias debug=:
+ alias mount=busybox mount
+ N=

+ _C=0
+ NO_EXPORT=1
+ LOAD_STATE=1
+ LIST_SEP=
+ reset_cb
+ [ -z  -a -f /lib/config/uci.sh ]
+ . /lib/config/uci.sh
+ CONFIG_APPEND=
+ [ 1 = 0 ]
+ [ xeth0 = x-a ]
+ include /lib/network
+ local file
+ ls /lib/network/config.sh
+ . /lib/network/config.sh
+ scan_interfaces
+ local cfgfile=
+ local mode iftype iface ifname device
+ interfaces=
+ config_load network
+ [ -n  ]
+ uci_load network
+ local PACKAGE=network
+ local DATA
+ local RET
+ _C=0
+ [ -z  ]
+ export -n CONFIG_SECTIONS=
+ export -n CONFIG_NUM_SECTIONS=0
+ export -n CONFIG_SECTION=
+ /sbin/uci -P /var/state -S -n export network
+ DATA=package 'network'

config 'interface' 'loopback'
        option 'ifname' 'lo'
        option 'proto' 'static'
        option 'ipaddr' '127.0.0.1'
        option 'netmask' '255.0.0.0'
        option 'device' 'lo'
        option 'up' '1'

config 'interface' 'lan'
        option 'ifname' 'eth0'
        option 'proto' 'dhcp'
        option 'device' 'eth0'
+ RET=0
+ [ 0 != 0 -o -z package 'network'

config 'interface' 'loopback'
        option 'ifname' 'lo'
        option 'proto' 'static'
        option 'ipaddr' '127.0.0.1'
        option 'netmask' '255.0.0.0'
        option 'device' 'lo'
        option 'up' '1'

config 'interface' 'lan'
        option 'ifname' 'eth0'
        option 'proto' 'dhcp'
        option 'device' 'eth0' ]
+ eval package 'network'

config 'interface' 'loopback'
        option 'ifname' 'lo'
        option 'proto' 'static'
        option 'ipaddr' '127.0.0.1'
        option 'netmask' '255.0.0.0'
        option 'device' 'lo'
        option 'up' '1'

config 'interface' 'lan'
        option 'ifname' 'eth0'
        option 'proto' 'dhcp'
        option 'device' 'eth0'
+ package network
+ return 0
+ config interface loopback
+ local cfgtype=interface
+ local name=loopback
+ export -n CONFIG_NUM_SECTIONS=1
+ name=loopback
+ append CONFIG_SECTIONS loopback
+ local var=CONFIG_SECTIONS
+ local value=loopback
+ local sep=
+ eval export -n -- "CONFIG_SECTIONS=${CONFIG_SECTIONS:+${CONFIG_SECTIONS}${value:+$sep}}$value"
+ export -n -- CONFIG_SECTIONS=loopback
+ [ -n  ]
+ config_cb interface loopback
+ config_set loopback auto 1
+ local section=loopback
+ local option=auto
+ local value=1
+ local old_section=
+ CONFIG_SECTION=loopback
+ option auto 1
+ local varname=auto
+ shift
+ local value=1
+ export -n CONFIG_loopback_auto=1
+ [ -n  ]
+ option_cb auto 1
+ return 0
+ CONFIG_SECTION=
+ config_get iftype  TYPE
+ eval export -n -- "iftype=${CONFIG__TYPE}"
+ export -n -- iftype=
+ export -n CONFIG_SECTION=loopback
+ export -n CONFIG_loopback_TYPE=interface
+ option ifname lo
+ local varname=ifname
+ shift
+ local value=lo
+ export -n CONFIG_loopback_ifname=lo
+ [ -n  ]
+ option_cb ifname lo
+ return 0
+ option proto static
+ local varname=proto
+ shift
+ local value=static
+ export -n CONFIG_loopback_proto=static
+ [ -n  ]
+ option_cb proto static
+ return 0
+ option ipaddr 127.0.0.1
+ local varname=ipaddr
+ shift
+ local value=127.0.0.1
+ export -n CONFIG_loopback_ipaddr=127.0.0.1
+ [ -n  ]
+ option_cb ipaddr 127.0.0.1
+ return 0
+ option netmask 255.0.0.0
+ local varname=netmask
+ shift
+ local value=255.0.0.0
+ export -n CONFIG_loopback_netmask=255.0.0.0
+ [ -n  ]
+ option_cb netmask 255.0.0.0
+ return 0
+ option device lo
+ local varname=device
+ shift
+ local value=lo
+ export -n CONFIG_loopback_device=lo
+ [ -n  ]
+ option_cb device lo
+ return 0
+ option up 1
+ local varname=up
+ shift
+ local value=1
+ export -n CONFIG_loopback_up=1
+ [ -n  ]
+ option_cb up 1
+ return 0
+ config interface lan
+ local cfgtype=interface
+ local name=lan
+ export -n CONFIG_NUM_SECTIONS=2
+ name=lan
+ append CONFIG_SECTIONS lan
+ local var=CONFIG_SECTIONS
+ local value=lan
+ local sep=
+ eval export -n -- "CONFIG_SECTIONS=${CONFIG_SECTIONS:+${CONFIG_SECTIONS}${value:+$sep}}$value"
+ export -n -- CONFIG_SECTIONS=loopback lan
+ [ -n  ]
+ config_cb interface lan
+ config_set lan auto 1
+ local section=lan
+ local option=auto
+ local value=1
+ local old_section=loopback
+ CONFIG_SECTION=lan
+ option auto 1
+ local varname=auto
+ shift
+ local value=1
+ export -n CONFIG_lan_auto=1
+ [ -n  ]
+ option_cb auto 1
+ return 0
+ CONFIG_SECTION=loopback
+ config_get iftype loopback TYPE
+ eval export -n -- "iftype=${CONFIG_loopback_TYPE}"
+ export -n -- iftype=interface
+ config_get proto loopback proto
+ eval export -n -- "proto=${CONFIG_loopback_proto}"
+ export -n -- proto=static
+ append interfaces loopback
+ local var=interfaces
+ local value=loopback
+ local sep=
+ eval export -n -- "interfaces=${interfaces:+${interfaces}${value:+$sep}}$value"
+ export -n -- interfaces=loopback
+ config_get iftype loopback type
+ eval export -n -- "iftype=${CONFIG_loopback_type}"
+ export -n -- iftype=
+ config_get ifname loopback ifname
+ eval export -n -- "ifname=${CONFIG_loopback_ifname}"
+ export -n -- ifname=lo
+ config_get device loopback device
+ eval export -n -- "device=${CONFIG_loopback_device}"
+ export -n -- device=lo
+ config_set loopback device lo
+ local section=loopback
+ local option=device
+ local value=lo
+ local old_section=loopback
+ CONFIG_SECTION=loopback
+ option device lo
+ local varname=device
+ shift
+ local value=lo
+ export -n CONFIG_loopback_device=lo
+ [ -n  ]
+ option_cb device lo
+ return 0
+ CONFIG_SECTION=loopback
+ export -n CONFIG_SECTION=lan
+ export -n CONFIG_lan_TYPE=interface
+ option ifname eth0
+ local varname=ifname
+ shift
+ local value=eth0
+ export -n CONFIG_lan_ifname=eth0
+ [ -n  ]
+ option_cb ifname eth0
+ return 0
+ option proto dhcp
+ local varname=proto
+ shift
+ local value=dhcp
+ export -n CONFIG_lan_proto=dhcp
+ [ -n  ]
+ option_cb proto dhcp
+ return 0
+ option device eth0
+ local varname=device
+ shift
+ local value=eth0
+ export -n CONFIG_lan_device=eth0
+ [ -n  ]
+ option_cb device eth0
+ return 0
+ unset DATA
+ config_cb
+ config_get iftype lan TYPE
+ eval export -n -- "iftype=${CONFIG_lan_TYPE}"
+ export -n -- iftype=interface
+ config_get proto lan proto
+ eval export -n -- "proto=${CONFIG_lan_proto}"
+ export -n -- proto=dhcp
+ append interfaces lan
+ local var=interfaces
+ local value=lan
+ local sep=
+ eval export -n -- "interfaces=${interfaces:+${interfaces}${value:+$sep}}$value"
+ export -n -- interfaces=loopback lan
+ config_get iftype lan type
+ eval export -n -- "iftype=${CONFIG_lan_type}"
+ export -n -- iftype=
+ config_get ifname lan ifname
+ eval export -n -- "ifname=${CONFIG_lan_ifname}"
+ export -n -- ifname=eth0
+ config_get device lan device
+ eval export -n -- "device=${CONFIG_lan_device}"
+ export -n -- device=eth0
+ config_set lan device eth0
+ local section=lan
+ local option=device
+ local value=eth0
+ local old_section=lan
+ CONFIG_SECTION=lan
+ option device eth0
+ local varname=device
+ shift
+ local value=eth0
+ export -n CONFIG_lan_device=eth0
+ [ -n  ]
+ option_cb device eth0
+ return 0
+ CONFIG_SECTION=lan
+ return 0
+ cfg=eth0
+ : ### ifdown eth0 ###
+ config_get proto eth0 proto
+ eval export -n -- "proto=${CONFIG_eth0_proto}"
+ export -n -- proto=
+ [ -z  ]
+ echo interface not found.
interface not found.
+ exit

it is amazing the amount of code we need in order to bring an interface up :-)

Attachments (0)

Change History (1)

comment:1 Changed 7 years ago by jow

  • Resolution set to worksforme
  • Status changed from new to closed

ifup / ifdown refer to logical interface names like "lan" or "wan", not the actual physical devices.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.