We created a bond interface formed by the eth1 and eth2 interfaces, set
with an IP.
We defined the bond interface (named "*bond0*") as follow:
"
ip link set eth1 down
ip link set eth2 down
echo "+bond0" > /sys/class/net/bonding_masters
echo active-backup > /sys/class/net/bond0/bonding/mode
echo "+eth1" > /sys/class/net/bond0/bonding/slaves
echo "+eth2" > /sys/class/net/bond0/bonding/slaves
echo 5 > /sys/devices/virtual/net/bond0/bonding/num_grat_arp
echo 50 > /sys/class/net/bond0/bonding/miimon
echo "eth1:1" > /sys/class/net/bond0/bonding/queue_id
echo "eth2:2" > /sys/class/net/bond0/bonding/queue_id
echo eth1 > /sys/devices/virtual/net/bond0/bonding/primary
echo "1" > /sys/devices/virtual/net/bond0/bonding/all_slaves_active
ip link set eth1 up
ip link set eth2 up
ip link set dev bond0 up
ip addr add 192.168.101.2/24 brd 192.168.101.255 dev bond0

"
the file */etc/config/network* is:
config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option packet_steering '1'
        option ula_prefix 'xxxxxxxxxxxx::/48'

config device 'device1'
        option name 'br-lan'
        list ports 'lan0'
        list ports 'lan1'
        list ports 'lan2'
        list ports 'lan3'
        option type 'bridge'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option dns '8.8.8.8'

config device 'device2'
        option macaddr 'xxxxxxxxxxxxx'
        option name 'eth2'

config interface 'plc1'
        option device 'eth2'
        option proto 'static'
        option ipaddr '192.168.30.10'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'plc0'
        option device 'eth1'
        option proto 'static'
        option ipaddr '192.168.20.10'
        option netmask '255.255.255.0'
        option ip6assign '60'

The device is connected to openwisp via the ip address associated with the
bond0 interface , I would like to add this information to the status menu.




Il giorno ven 15 mar 2024 alle ore 15:22 Federico Capoano <
f.capo...@openwisp.io> ha scritto:

> Hi Daniele,
>
> Could you share the OpenWrt UCI configuration sample for your use case so
> we can better understand what you're trying to do?
> What do you mean by "main ip address"? Is this the management interface
> address? Or what exactly?
>
> The library which deals with configurations is here:
> https://github.com/openwisp/netjsonconfig/
> Docs: https://netjsonconfig.openwisp.org/en/latest/
>
> Federico
>
> --
> You received this message because you are subscribed to the Google Groups
> "OpenWISP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to openwisp+unsubscr...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/openwisp/CAAGgX6%2BLA-9p9VBLLb0NRx%3DgYkBC%3D5xQXMQQZMPSzdx4U9JNJg%40mail.gmail.com
> <https://groups.google.com/d/msgid/openwisp/CAAGgX6%2BLA-9p9VBLLb0NRx%3DgYkBC%3D5xQXMQQZMPSzdx4U9JNJg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>


-- 

*Daniele Cerasuolo*

Via Diocleziano, 107

80125 – Napoli (NA) , Italy

Mail: d.cerasu...@gematica.com

Website: www.gematica.com

INFO PRIVACY

= = = = = = = = = = = = = = = = = = = =

The content of this e-mail and its attachments are exclusively directed to
the receiver and must be considered  confidential under embargo or use for
any purpose for which this e-mail was sent. Therefore, it is prohibited  the
dissemination and communication by persons other than the receiver,
under Italian
Law, ( Artt. 616 e ss.  c.p. e D.lgs n. 196/03 Codice Privacy). If this
e-mail and its attachments have been received in error, please destroy what
has been received and  notify the sender at the following address:
i...@gematica.com

-- 
You received this message because you are subscribed to the Google Groups 
"OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to openwisp+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/openwisp/CA%2B7VT_DMHy8bpBoq3wVuFMPBNrDy5T3C1B%2BS%3DKJ4onOo84p3Ww%40mail.gmail.com.

Reply via email to