diff --git a/package/gluon-core/files/lib/netifd/proto/gluon_mesh.sh b/package/gluon-core/files/lib/netifd/proto/gluon_mesh.sh index 52d6abec..51412e5f 100755 --- a/package/gluon-core/files/lib/netifd/proto/gluon_mesh.sh +++ b/package/gluon-core/files/lib/netifd/proto/gluon_mesh.sh @@ -7,6 +7,8 @@ init_proto "$@" proto_gluon_mesh_init_config() { proto_config_add_boolean fixed_mtu proto_config_add_boolean transitive + proto_config_add_string ipaddr + proto_config_add_string ip6addr } proto_gluon_mesh_setup() { @@ -28,6 +30,14 @@ proto_gluon_mesh_setup() { proto_add_data json_add_boolean fixed_mtu "$FIXED_MTU" json_add_boolean transitive "$TRANSITIVE" + if [ ! -n "$ipaddr" ]; then + json_add_string ipaddr "$ipaddr" + ip addr add "$ipaddr" dev "$IFNAME" + fi + if [ ! -n "$ip6addr" ]; then + json_add_string ip6addr "$ip6addr" + ip addr add "$ip6addr" dev "$IFNAME" + fi [ "$IFNAME" != 'br-wan' ] && json_add_string zone 'mesh' proto_close_data proto_send_update "$CONFIG" diff --git a/package/gluon-core/files/lib/netifd/proto/gluon_wired.sh b/package/gluon-core/files/lib/netifd/proto/gluon_wired.sh index 796ee3e5..3f7a8c10 100755 --- a/package/gluon-core/files/lib/netifd/proto/gluon_wired.sh +++ b/package/gluon-core/files/lib/netifd/proto/gluon_wired.sh @@ -9,6 +9,8 @@ proto_gluon_wired_init_config() { proto_config_add_int index proto_config_add_boolean vxlan proto_config_add_string vxpeer6addr + proto_config_add_string ipaddr + proto_config_add_string ip6addr } xor2() { @@ -79,6 +81,12 @@ proto_gluon_wired_setup() { json_add_string ifname "@${meshif}" json_add_string proto 'gluon_mesh' json_add_boolean fixed_mtu 1 + if [ ! -n "$ipaddr" ]; then + json_add_string ipaddr "$ipaddr" + fi + if [ ! -n "$ip6addr" ]; then + json_add_string ip6addr "$ip6addr" + fi [ -n "$transitive" ] && json_add_boolean transitive "$transitive" json_close_object ubus call network add_dynamic "$(json_dump)"