-3

i wanna get router ip address,i got code for how to get ip address but i didn't get router ip address(Ex: 20.30.40.01 like that).any one know please ping me..

3 Answers3

0

If you want the external address:

curl -4 ifconfig.co
curl -6 ifconfig.co

If you want the internal address:

Check if your code also returns the gateway, that's the routers internal address

Martin
  • 2,754
  • 1
  • 15
  • 35
0

Follow the below steps:- 1)Go to Settings 2)Network 3)Advanced 4)Select TCP/IP tab You will get IP address of MAC.

poojathorat
  • 1,200
  • 2
  • 9
  • 19
-1

Your local network router is always at 192.168.1.1 it plays the role of "machine 1" on the local network, or the last 1 in 192.168.1."1"

In the event this is not typically default, and to program it into your application I would refer to the code in this posting: (How can I determine the default gateway on iPhone?)

open up terminal, type:

  1. scutil
  2. list (Lists all your settings)
  3. show State:/Network/Global/DNS
  4. Terminal should read "192.168.1.1" or other primary connection(router ip)
  5. Should be able to script that and include it into your apps. :)

Happy Coding Ahead!

Community
  • 1
  • 1
Mike Horstmann
  • 580
  • 2
  • 9