mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-24 04:26:16 +02:00
[package] base-files: Add support for assigning multiple IPv6 addresses on an interface
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@28222 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
3c978d1604
commit
e926403b86
@ -242,10 +242,10 @@ setup_interface_static() {
|
|||||||
local iface="$1"
|
local iface="$1"
|
||||||
local config="$2"
|
local config="$2"
|
||||||
|
|
||||||
local ipaddr netmask ip6addr
|
local ipaddr netmask ip6addrs ipaddr
|
||||||
config_get ipaddr "$config" ipaddr
|
config_get ipaddr "$config" ipaddr
|
||||||
config_get netmask "$config" netmask
|
config_get netmask "$config" netmask
|
||||||
config_get ip6addr "$config" ip6addr
|
config_get ip6addrs "$config" ip6addr
|
||||||
[ -z "$ipaddr" -o -z "$netmask" ] && [ -z "$ip6addr" ] && return 1
|
[ -z "$ipaddr" -o -z "$netmask" ] && [ -z "$ip6addr" ] && return 1
|
||||||
|
|
||||||
local gateway ip6gw dns bcast metric
|
local gateway ip6gw dns bcast metric
|
||||||
@ -255,13 +255,14 @@ setup_interface_static() {
|
|||||||
config_get bcast "$config" broadcast
|
config_get bcast "$config" broadcast
|
||||||
config_get metric "$config" metric
|
config_get metric "$config" metric
|
||||||
|
|
||||||
case "$ip6addr" in
|
|
||||||
*/*) ;;
|
|
||||||
*:*) ip6addr="$ip6addr/64" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
[ -z "$ipaddr" ] || $DEBUG ifconfig "$iface" "$ipaddr" netmask "$netmask" broadcast "${bcast:-+}"
|
[ -z "$ipaddr" ] || $DEBUG ifconfig "$iface" "$ipaddr" netmask "$netmask" broadcast "${bcast:-+}"
|
||||||
[ -z "$ip6addr" ] || $DEBUG ifconfig "$iface" add "$ip6addr"
|
for ip6addr in $ip6addrs; do
|
||||||
|
case "$ip6addr" in
|
||||||
|
*/*) ;;
|
||||||
|
*:*) ip6addr="$ip6addr/64" ;;
|
||||||
|
esac
|
||||||
|
$DEBUG ifconfig "$iface" add "$ip6addr"
|
||||||
|
done
|
||||||
[ -z "$gateway" ] || $DEBUG route add default gw "$gateway" ${metric:+metric $metric} dev "$iface"
|
[ -z "$gateway" ] || $DEBUG route add default gw "$gateway" ${metric:+metric $metric} dev "$iface"
|
||||||
[ -z "$ip6gw" ] || $DEBUG route -A inet6 add default gw "$ip6gw" ${metric:+metric $metric} dev "$iface"
|
[ -z "$ip6gw" ] || $DEBUG route -A inet6 add default gw "$ip6gw" ${metric:+metric $metric} dev "$iface"
|
||||||
[ -z "$dns" ] || add_dns "$config" $dns
|
[ -z "$dns" ] || add_dns "$config" $dns
|
||||||
|
Loading…
Reference in New Issue
Block a user