Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Default Gateway macOS #41

Open
Lucaslah opened this issue Sep 13, 2020 · 0 comments
Open

Get Default Gateway macOS #41

Lucaslah opened this issue Sep 13, 2020 · 0 comments

Comments

@Lucaslah
Copy link

Lucaslah commented Sep 13, 2020

On macOS the get default gateway script dose not work.

network.get_gateway_ip(function(err, ip) {
  console.log(err || ip); // err may be 'No active network interface found.'
})

This is because the command ipconfig getoption en0 router dose not work on macOS

Here is the error:

Error: Command failed: ipconfig getoption en0 router

    at ChildProcess.exithandler (child_process.js:308:12)
    at ChildProcess.emit (events.js:314:20)
    at maybeClose (internal/child_process.js:1047:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
  killed: false,
  code: 1,
  signal: null,
  cmd: 'ipconfig getoption en0 router'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant