Results 1 to 9 of 9

Thread: Find the IP address of a router via CLI

  1. #1
    Join Date
    Oct 2008
    Beans
    158
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Find the IP address of a router via CLI

    From the command line, how would I obtain the IP address of a router, prior to connecting to it?
    √ is /

  2. #2
    Join Date
    Feb 2008
    Location
    Decatur, GA
    Beans
    1,157
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Find the IP address of a router via CLI

    I can't think of any way to do so, except to do

    Code:
    sudo dhclient eth0
    (substituting your interface name for "eth0"), which will assign the IP and gateway automatically.

    Of course, I also can't think of a graphical way to discover this either.

    May I ask why you need to do this?
    yeats - Ubuntu 13.04

  3. #3
    Join Date
    Oct 2008
    Beans
    158
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Find the IP address of a router via CLI

    Well, it is actually for dslinux (not damn small linux) which is linux on the nintendo ds.

    In order to connect to the internet, you must type the following:
    Code:
    iwconfig nds channel 6 essid SoftAP-91 key 0102031a2b
    ifconfig nds 192.168.1.2 up
    route add default gw 192.168.1.1
    Where the router IP address is 192.168.1.1, Channel is 6, Essid is SoftAP-91 and the IP of the ds is to be 192.168.1.2.

    However, if you are in a wifi hotspot, and all you have is the DS, you need some method of determining the IP of the router in order to determine connect to the internet.

    From the dslinux wiki:

    Most routers hand out IP addresses to computers on the network dynamically via the DHCP protocol. DHCP does not work for most people in dslinux, so you should consider giving your DS a static IP address. 'Static' means the IP address is assigned manually without DHCP
    So, you can see I am something of a difficult situation.
    √ is /

  4. #4
    Join Date
    Oct 2007
    Beans
    1,832

    Re: Find the IP address of a router via CLI

    So you want to know the ip of the router before you connect to it? What sort of information does the ds provide before you connect?

  5. #5
    Join Date
    Jul 2005
    Location
    DC / Richmond VA area
    Beans
    383
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Find the IP address of a router via CLI

    If I understand correctly, you need the IP address of a router so you can connect to it with the DS? I can't think of anyway you can do that without being connected to the network. Even if you could, there is no way to know if you are assigning yourself an IP address that is available. Also, I suspect that public wifi routers might frequently configured to not allow static IPs to connect as I can think of a couple of ways to misuse that power.

    If you could get somebody else at the hotspot to tell you their IP address you could probably assign yourself something in the range and hope for the best.

  6. #6
    Join Date
    Oct 2008
    Beans
    158
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Find the IP address of a router via CLI

    The DS tells me nothing regarding the router prior to connection, short of ESSID, channel and MAC address.

    So I have to ask people what their IP is. I can see that turning into an awkward conversation:

    Me: Sir, could you please tell me your local IP?
    Average User: My what?
    Me: Its like a mailbox, used to, nevermind. Give me your computer/
    Average User: Hey! That's mine!
    Me: It's ok sir, I'm just trying to ssh from a nintendo ds...
    √ is /

  7. #7
    Join Date
    Oct 2007
    Beans
    1,832

    Re: Find the IP address of a router via CLI

    If you could look at it, you can usually tell. dlink uses 192.168.0.100 by default, whereas linksys uses 192.168.1.100 by default, if I remember.

    You could just make a list of the most common ones. Or unfortunately, it looks like trial and error.

  8. #8
    Join Date
    Oct 2008
    Beans
    158
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Find the IP address of a router via CLI

    Quote Originally Posted by llamabr View Post
    If you could look at it, you can usually tell. dlink uses 192.168.0.100 by default, whereas linksys uses 192.168.1.100 by default, if I remember.

    You could just make a list of the most common ones. Or unfortunately, it looks like trial and error.
    Thanks, I guess I shall have to do that. Seems like the best solution so far.
    √ is /

  9. #9
    Join Date
    Feb 2007
    Location
    Virginia
    Beans
    170
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Find the IP address of a router via CLI

    Just enter your router via your web browser. Just type
    http://192.168.1.1 and enter if Linksys. Look under tab that shows who's on and it will list the IP addresses. You also have to know your name and password....usually admin, password, Look at the manual for you router or look up your routers support page the web on how to access router via web browser.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •