|
|
x="-net ${x}" | x="-net ${x}" |
elif [[ ${y} == *.*.*.*/32 ]] ; then | elif [[ ${y} == *.*.*.*/32 ]] ; then |
x="-host ${x}" | x="-host ${x}" |
elif [[ ${y} == *.*.*.*/* ]] ; then |
elif [[ ${y} == *.*.*.*/* || ${y} == "default" || ${y} == "0.0.0.0" ]] ; then |
x="-net ${x}" | x="-net ${x}" |
else | else |
# Given the lack of a netmask, we assume a host | # Given the lack of a netmask, we assume a host |
|
|
config=( "${config[@]//peer/pointopoint}" ) | config=( "${config[@]//peer/pointopoint}" ) |
fi | fi |
| |
# Ensure that the interface is up so we can add IPv6 addresses |
|
interface_up "${real_iface}" |
|
|
|
# Some kernels like to apply lo with an address when they are brought up | # Some kernels like to apply lo with an address when they are brought up |
if [[ ${config[@]} == "127.0.0.1 netmask 255.0.0.0 broadcast 127.255.255.255" ]]; then | if [[ ${config[@]} == "127.0.0.1 netmask 255.0.0.0 broadcast 127.255.255.255" ]]; then |
is_loopback "${iface}" && ifconfig "${iface}" 0.0.0.0 |
if is_loopback "${real_iface}" ; then |
|
ifconfig "${real_iface}" ${config[@]} |
|
return 0 |
|
fi |
fi | fi |
| |
ifconfig "${iface}" ${config[@]} | ifconfig "${iface}" ${config[@]} |