Giter Site home page Giter Site logo

Comments (3)

PabloCastellano avatar PabloCastellano commented on June 11, 2024

@nemesisdesign Apparently the arp command is deprecated and ip neigh is the way to go. In fact arp in the latest version of openwrt is an alias to cat /proc/net/arp.

Here is an example of the output of both so you can compare:

root@08-00-27-5D-DF-07:~# ip neigh
10.0.3.3 dev eth1 lladdr 52:54:00:12:35:03 used 0/0/0 probes 1 STALE
192.168.1.34 dev eth2 lladdr 18:5e:0f:12:12:0e used 0/0/0 probes 1 STALE
10.0.3.2 dev eth1 lladdr 52:54:00:12:35:02 used 0/0/0 probes 4 STALE
192.168.1.1 dev eth2 lladdr cc:d4:a1:06:dd:0a ref 1 used 0/0/0 probes 1 REACHABLE
192.168.56.1 dev br-mng lladdr 0a:00:27:00:00:00 ref 1 used 0/0/0 probes 4 REACHABLE
fe80::9a9c:57ff:fe8b:4f67 dev eth2 lladdr 98:9c:57:8b:4f:67 ref 1 used 0/0/0 probes 1 DELAY
fe80::2e0e:3dff:fed6:506 dev eth2 lladdr 2c:0e:3d:d6:05:06 ref 1 used 0/0/0 probes 1 REACHABLE
fe80::ced4:a1ff:fe06:dd0a dev eth2 lladdr cc:d4:a1:06:dd:0a router used 0/0/0 probes 0 STALE
fe80::be3d:85ff:fed7:53e0 dev eth2 lladdr bc:3d:85:d7:53:e0 used 0/0/0 probes 1 STALE
root@08-00-27-5D-DF-07:~# arp
IP address       HW type     Flags       HW address            Mask     Device
10.0.3.3         0x1         0x2         52:54:00:12:35:03     *        eth1
192.168.1.34     0x1         0x2         18:5e:0f:12:12:0e     *        eth2
10.0.3.2         0x1         0x2         52:54:00:12:35:02     *        eth1
192.168.1.1      0x1         0x2         cc:d4:a1:06:dd:0a     *        eth2
192.168.56.1     0x1         0x2         0a:00:27:00:00:00     *        br-mng

Should we still go with arp?

from openwrt-openwisp-monitoring.

nemesifier avatar nemesifier commented on June 11, 2024

@PabloCastellano thanks for bringing this up, that's great.

Take a look at this:

# installs the full IP package
# (the default one I think is a stripped down version available in busybox)
opkg install ip
ip -json neighbour

The full ip package has a -json flag so you can avoid having to parse it.

We can use its format as is, this should reduce friction when we will try adding this kind of features on other embedded OSes in the future.

from openwrt-openwisp-monitoring.

PabloCastellano avatar PabloCastellano commented on June 11, 2024

Since the output of ip neigh can be very different depending on the version, my PR just parses /proc/net/arp so far

from openwrt-openwisp-monitoring.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.