Page 1 of 3 123 LastLast
Results 1 to 10 of 28

Thread: command to find router ip address ?

  1. #1
    Join Date
    Apr 2007
    Location
    South Carolina
    Beans
    951
    Distro
    Ubuntu Studio 16.04 Xenial Xerus

    command to find router ip address ?

    Is there is a command in Ubuntu that would tell anything about a router that is being used as an extender?
    Here's my situation,
    I have two TP Link wireless routers wired together. The first one is the main one connected to my cable internet & the second one is wired to that one as an extender. The first one is not a problem to access because I use the typical 192.168.0.1 default gateway to access & check or change all my settings. The second one in order to make it work as an extender I disabled DHCP & changed the default gateway. I did that about two years ago & I can't remember the default gateway that I used. I used to access it from my desktop to check or change settings but I need to know the address & I'm not sure if it's 192.168..0.x or 192.168.1.x. Nothing on my main router tells me about the secondary router so I'm at a loss. I tried plugging my laptop into the secondary router & that didn't help.
    I don't want to have to do a factory reset if I can help it. Is there any terminal command that might help?
    Gary

    I wish I knew what I used to know before I knew what I didn't know.

  2. #2
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    15,484
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: command to find router ip address ?

    Try installing nmap and doing a ping scan of the networks:
    Code:
    sudo apt install nmap
    nmap -sP 192.168.1.0/24
    will try every IP from 192.168.1.1 to 192.168.1.254.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    22,105
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: command to find router ip address ?

    • arp
    • nmap -sT {subnet/24}
    • traceroute if the device is using the 2nd router to connect to the 1st router.


    It is a good idea to write network info on a 3x5 card and use painters tape to put it on the different network devices.
    For a router, that info should be:
    • wan ip/network
    • lan IP/network
    • gateway
    • login account and ... which password manager db has the password for the different accounts.

  4. #4
    Join Date
    Apr 2007
    Location
    South Carolina
    Beans
    951
    Distro
    Ubuntu Studio 16.04 Xenial Xerus

    Re: command to find router ip address ?

    Quote Originally Posted by SeijiSensei View Post
    Try installing nmap and doing a ping scan of the networks:
    Code:
    sudo apt install nmap
    nmap -sP 192.168.1.0/24
    will try every IP from 192.168.1.1 to 192.168.1.254.
    i tried that & all I got back was:
    Starting Nmap 7.60 ( https://nmap.org ) at 2020-11-16 21:01 EST
    Nmap done: 256 IP addresses (0 hosts up) scanned in 104.16 seconds
    Gary

    I wish I knew what I used to know before I knew what I didn't know.

  5. #5
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: command to find router ip address ?

    Second router
    https://www.linksys.com/ca/support-a...icleNum=155108
    Did you do LAN to LAN or LAN to WAN?
    If you know settings on first, plug computer just into second router and check or change settings.

    Do you have settings from first Router?
    And then reconfigure second router as per video.

    I just did this on my system LAN to LAN, but cheap Chinese router from cable vendor has different configuration and my Linksys is older so not quite the same.
    My systems shows second router with nmap, but first router still shows it incorrectly, but it works.

    Channel was auto chgd to 5
    wireless mode Mixed b/g/n
    SSID/Network name
    Security mode: WPA2/WPAz-PSK-TKIPP/AES
    IP: 192.168.1.1 I then used .2 on second router.
    Tried with & without binding by MAC - without worked finally
    But set DHCP to start at 3 and Linksys at 2
    Still shows as 0000 in status, but nmap still shows and can log in to it

    Second router
    Channel 11
    Advanced NAT (or router mode) off (could not find on mine)
    Same Security mode:
    set to 192.168.1.2 network setup
    Set SSID & password
    Disable DHCP
    save
    Last edited by oldfred; November 17th, 2020 at 03:57 AM.
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  6. #6
    Join Date
    Apr 2007
    Location
    South Carolina
    Beans
    951
    Distro
    Ubuntu Studio 16.04 Xenial Xerus

    Re: command to find router ip address ?

    I did LAN to LAN & set up the secondary router exactly as it was shown in the video except I don't know what address I changed the default gateway to . It's been working fine for a couple years but I want to get into the setup of the secondary router. Unless I can find the ip address that I changed it to, I'll probably have to do a factory reset to get into the setup if I can't figure out the ip address but I was hoping there was an easier way. Next time I'll know better to write the address down & tape it to the router.
    Gary

    I wish I knew what I used to know before I knew what I didn't know.

  7. #7
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: command to find router ip address ?

    If LAN to LAN then should be .2 where main router is .1.
    So check full setting on main router.

    Once you change address on second router you have to use that to log into it as default does not work.
    I thought I had changed it correct several times, but could not log in either new address or old login. So had to reset & start over.
    And DHCP range overlapped .2 originally. Was not sure whether I had to add .2 as fixed on first router but have in DHCP as it then would know it was fixed.
    Or exclude from DHCP and then just set second router to .2, which then now seems to work.
    Last edited by oldfred; November 17th, 2020 at 03:27 PM.
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  8. #8
    Join Date
    May 2010
    Beans
    942

    Re: command to find router ip address ?

    Code:
    #internal router IP
    ip route show | head -n 1 | awk {'print $3'}
    .
    Code:
    #External IP
    wget -q -O - https:\\ip.keithscode.com`
    Nice and easy

  9. #9
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    22,105
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: command to find router ip address ?

    Quote Originally Posted by ActionParsnip View Post
    Code:
    #internal router IP
    ip route show | head -n 1 | awk {'print $3'}
    This assumes a normal setup and is very handy for that. I use an alias to make the 'ip' cmd prettier.
    Code:
    alias iproute='ip route | column -t'
    Or the old cmd, route -n does this automatically.

    But with a setup like this:
    Code:
    Internet -- Router1 -- Router2 -- computerB
                        |
                        +- computerA
    ComputerA won't see Router2, but arp should see the WAN interface for Router2 ... assuming it is being used as a router. But it could be used as a plain switch by ignoring the WAN port, setting the LAN IP for Router2 to be an unused, outside-the-DHCP range managed by Router1 ...
    I'll add a photo in a few minutes of the port connections.

  10. #10
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    22,105
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: command to find router ip address ?

    Attached is an image of a wifi/router that has been repurposed to be only a wifi-access point for guest use. The vendor stopped updating the firmware AND no 3rd party firmware like dd-wrt or openwrt is compatible.

    The Blue RJ-45 is the WAN port. It is empty. Unused.

    The Yellow RJ-45 ports are for the LAN. Only 1 port is used, which eventually connects back to the ISP-provided router and gets a DHCP-reserved IP from that ISP-router. That makes the IP effectively static. I force a x.x.x.254 IP for it. The .254 IP is outside the dynamic DHCP range provided to random devices. This part of my network is outside any trusted network. I don't trust wifi unless a vpn or ssh is used. If I didn't have this $130 when new device already, I'd get a $80 Ubiquiti AP. That's what I've deployed to clients and they work extremely well to get an AP where it is actually needed, not limited to where a wall power plug is available.

    This router has almost all normal router services disabled. No DHCP. No DNS.

    Hopefully, this clarifies things and the image helps.

    To expand my network between floors, I use a Powerline 600 Mbps setup - that's the claim on the box. They have 1200 Mbps Powerline today. For my connections between 2 devices at each end, I'm seeing a stable 60+ Mbps bandwidth. YMMV. If I were doing this today, I'd get a MoCa 2Gbps setup instead. This requires that COAX cable exist in the locations already, which is the case here. Moca is supposed to actually provide the bandwidth claimed. Moca is more expensive, but over a 10-20 yr life, that $40 price difference really doesn't matter too much. I'm not a fan of using wifi-to-wifi extenders. I'm not a fan of wifi unless absolutely necessary. In a prior job, I designed and deployed wifi for over 1200 locations and saw how local conditions could make that a nightmare for connectivity and unrealistic expectations. In short, stay wired whenever possible. And never trust any RF/wifi/BT for security.

    To find RouterA ... it is just the default gateway in the ip route and route -n for any machines.
    To find RouterB ... I use an nmap scan .... sudo nmap -O 10.22.21.0/24
    The results are longer than I'll show here, but ...
    Code:
    Nmap scan report for tp-link (10.22.21.254)
     90:F6:52:FF:FF:FF (Tp-link Technologies)
     OS CPE: cpe:/o:linux:linux_kernel:2.6.15
     OS details: Linux (likely TP-LINK WAP)
    those are part of the output for the scan. I have script that formats the scan output so I can find devices on the network that I've forgotten. There's usually an extra r-pi somewhere. The system doing the scan is upstream from RouterB, not a client. RouterB is on a different subnet than the other routerA connections in my world.
    Attached Images Attached Images
    Last edited by TheFu; November 18th, 2020 at 08:32 PM.

Page 1 of 3 123 LastLast

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
  •