# Asking for help with IP nodes (getting network IP information)

**URL:** <https://discourse.nodered.org/t/asking-for-help-with-ip-nodes-getting-network-ip-information/70550>\
**Category:** General\
**Created:** [13 November 2022 20:24 UTC](https://discourse.nodered.org/t/asking-for-help-with-ip-nodes-getting-network-ip-information/70550 "2022-11-13T20:24:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [13 November 2022 20:24 UTC](https://discourse.nodered.org/t/asking-for-help-with-ip-nodes-getting-network-ip-information/70550/1 "2022-11-13T20:24:03Z")

</div>

Although I don't really need it, a problem has happened and I am wanting to use NR to _help_ me with things.

I know I can use the `host_IP` node to get the IP of that machine, but I am wanting to get **more** information than just that.

I'm wanting to get/know the `gateway` also.  
(And probably `subnet` and so on. Small steps at the start.)

I am not sure if such nodes exist - and there is nothing stopping me searching, but for **what** do I search.  
I may search for what I think is the right term and get no results.  
If I use a different term - of which I don't know - I would get results.

Someone? 😉

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [13 November 2022 20:57 UTC](https://discourse.nodered.org/t/asking-for-help-with-ip-nodes-getting-network-ip-information/70550/2 "2022-11-13T20:57:47Z")

</div>

You can always use an `exec` node to send commands and look at the output. Try this one"  
`ip r | grep default`

Try this flow:

```auto
[{"id":"be67361ec73c22c4","type":"inject","z":"98ab90c151b96159","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"ip route | grep default","payloadType":"str","x":220,"y":560,"wires":[["305cc996126ee9a5"]]},{"id":"c9a114a973dbb2da","type":"debug","z":"98ab90c151b96159","name":"debug 35","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":720,"y":500,"wires":[]},{"id":"305cc996126ee9a5","type":"exec","z":"98ab90c151b96159","command":"","addpay":"payload","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"","x":430,"y":560,"wires":[["c9a114a973dbb2da"],["7e377194af54b2aa"],["a8d551509a9038a0"]]},{"id":"7e377194af54b2aa","type":"debug","z":"98ab90c151b96159","name":"debug 36","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":720,"y":560,"wires":[]},{"id":"a8d551509a9038a0","type":"debug","z":"98ab90c151b96159","name":"debug 37","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":720,"y":620,"wires":[]},{"id":"a384c836e1be463a","type":"catch","z":"98ab90c151b96159","name":"","scope":null,"uncaught":false,"x":240,"y":640,"wires":[["772bea42be29c0ba"]]},{"id":"772bea42be29c0ba","type":"debug","z":"98ab90c151b96159","name":"debug 38","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":460,"y":660,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [14 November 2022 00:18 UTC](https://discourse.nodered.org/t/asking-for-help-with-ip-nodes-getting-network-ip-information/70550/3 "2022-11-14T00:18:18Z")

</div>

Thanks Paul, but I seem to suffering with lack of intelligence these days.

When I import your flow and run it, I see this error:

```auto
{"_msgid":"f5b34ce0.cce3f","payload":"ip route | grep default","topic":"","error":{"message":"TypeError: \"file\" argument must be a non-empty string","source":{"id":"305cc996126ee9a5","type":"exec","count":1},"stack":"TypeError: \"file\" argument must be a non-empty string\n at normalizeSpawnArguments (child_process.js:389:11)\n at exports.spawn (child_process.js:502:38)\n at Object.exports.execFile (child_process.js:218:15)\n at exports.exec (child_process.js:148:18)\n at ExecNode._inputCallback (/usr/lib/node_modules/node-red/node_modules/@node-red/nodes/core/function/90-exec.js:134:29)\n at hooks.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:203:26)\n at Object.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/hooks.js:113:9)\n at ExecNode.Node._emitInput (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:195:11)\n at ExecNode.Node.emit (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:179:25)\n at ExecNode.Node.receive (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:476:10)"}}

```

But if I run the command it works.

I changed it and put the command in the `exec` node and unticked the `include msg.payload` and it works.

Thanks.  
(I am using an old version of NR on this machine. 1.2.6)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [28 November 2022 00:19 UTC](https://discourse.nodered.org/t/asking-for-help-with-ip-nodes-getting-network-ip-information/70550/4 "2022-11-28T00:19:11Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
