proto_config_add_string username
proto_config_add_string password
[ -e /proc/sys/net/ipv6 ] && proto_config_add_string ipv6
- proto_config_add_boolean dhcp
- proto_config_add_boolean dhcpv6
+ proto_config_add_string dhcp
+ proto_config_add_string dhcpv6
proto_config_add_string pdptype
proto_config_add_int mtu
proto_config_add_defaults
proto_init_update "$ifname" 1
proto_send_update "$interface"
- [ -z "$dhcp" ] && dhcp=1
- [ -z "$dhcpv6" ] && dhcpv6=1
+ [ -z "$dhcp" ] && dhcp="auto"
+ [ -z "$dhcpv6" ] && dhcpv6="auto"
[ "$iptype" != "ipv6" ] && {
json_init
json_add_string name "${interface}_4"
json_add_string ifname "@$interface"
ipv4address=$(_proto_mbim_get_field ipv4address "$mbimconfig")
- if [ -n "$ipv4address" ]; then
+ if [ -n "$ipv4address" -a "$dhcp" != 1 ]; then
json_add_string proto "static"
json_add_array ipaddr
json_add_string proto "dhcp"
fi
- [ "$peerdns" = 0 ] || {
+ [ "$peerdns" = 0 -a "$dhcp" != 1 ] || {
json_add_array dns
for server in $(_proto_mbim_get_field ipv4dnsserver "$mbimconfig"); do
json_add_string "" "$server"
json_add_string name "${interface}_6"
json_add_string ifname "@$interface"
ipv6address=$(_proto_mbim_get_field ipv6address "$mbimconfig")
- if [ -n "$ipv6address" ]; then
+ if [ -n "$ipv6address" -a "$dhcpv6" != 1 ]; then
json_add_string proto "static"
json_add_array ip6addr
json_add_string extendprefix 1
fi
- [ "$peerdns" = 0 ] || {
+ [ "$peerdns" = 0 -a "$dhcpv6" != 1 ] || {
json_add_array dns
for server in $(_proto_mbim_get_field ipv6dnsserver "$mbimconfig"); do
json_add_string "" "$server"