for dev in /sys/class/net/wds${device##wl}-* /sys/class/net/${device}-* /sys/class/net/${device}; do
if [ -e "$dev" ]; then
ifname=${dev##/sys/class/net/}
- ifconfig "$ifname" down
+ ip link set dev "$ifname" down
unbridge "$ifname"
fi
done
local if_cmd="if_pre_up"
[ "$ifname" != "${ifname##${device}-}" ] && if_cmd="if_up"
append $if_cmd "macaddr=\$(wlc ifname '$ifname' cur_etheraddr)" ";$N"
- append $if_cmd "ifconfig '$ifname' \${macaddr:+hw ether \$macaddr}" ";$N"
- append if_up "ifconfig '$ifname' up" ";$N"
+ append $if_cmd "ip link set dev '$ifname' address \$macaddr" ";$N"
+ append if_up "ip link set dev '$ifname' up" ";$N"
local net_cfg="$(find_net_config "$vif")"
[ -z "$net_cfg" ] || {
set $line
[ -f "/var/run/wifi-${1}.pid" ] &&
kill "$(cat "/var/run/wifi-${1}.pid")"
- ifconfig "$1" down
+ ip link set dev "$1" down
unbridge "$1"
iwpriv "$phy" wds_del "$2"
done
hostapd_setup_vif "$vif" hostap || {
echo "enable_prism2($device): Failed to set up hostapd for interface $ifname" >&2
# make sure this wifi interface won't accidentally stay open without encryption
- ifconfig "$ifname" down
+ ip link set dev "$ifname" down
continue
}
fi
if eval "type wpa_supplicant_setup_vif" 2>/dev/null >/dev/null; then
wpa_supplicant_setup_vif "$vif" wext || {
echo "enable_prism2($device): Failed to set up wpa_supplicant for interface $ifname" >&2
- ifconfig "$ifname" down
+ ip link set dev "$ifname" down
continue
}
fi
# All interfaces must have unique mac addresses
# which can either be explicitly set in the device
# section, or automatically generated
- ifconfig "$ifname" hw ether "$macaddr"
+ ip link set dev "$ifname" address "$macaddr"
fi
json_select ..
json_get_vars mode
json_get_var vif_txpower txpower
- ifconfig "$ifname" up || {
+ ip link set dev "$ifname" up || {
wireless_setup_vif_failed IFUP_ERROR
json_select ..
return
local phy="$1"
for wdev in $(list_phy_interfaces "$phy"); do
- ifconfig "$wdev" down 2>/dev/null
+ ip link set dev "$wdev" down 2>/dev/null
iw dev "$wdev" del
done
}
[ -d "/sys/kernel/debug/trelay/${dev1}-${dev2}" ] && return
[ -d "/sys/class/net/${dev1}" -a -d "/sys/class/net/${dev2}" ] || return
- ifconfig "$dev1" up
- ifconfig "$dev2" up
+ ip link set dev "$dev1" up
+ ip link set dev "$dev2" up
echo "${dev1}-${dev2},${dev1},${dev2}" > /sys/kernel/debug/trelay/add
}
local name
config_get name "$1" name
name="${name:-$1}"
- [ -d "/sys/class/net/$name" ] && ifconfig "$name" up
+ [ -d "/sys/class/net/$name" ] && ip link set dev "$name" up
swconfig dev "$name" load network
}
CONFIGURE_VARS += \
IFCONFIG=/sbin/ifconfig \
ROUTE=/sbin/route \
- IPROUTE=/usr/sbin/ip \
+ IPROUTE=/sbin/ip \
NETSTAT=/sbin/netstat
define Build/Configure
setup_switch_vlan() {
config_get ports "$CONFIG_SECTION" "eth$1"
ports=`echo "$ports"| sed s/" "/""/g`
- ifconfig eth$1 down
+ ip link set dev eth$1 down
admswconfig eth$1 ${ports}c
- ifconfig eth$1 up
+ ip link set dev eth$1 up
}
setup_switch() {