[SOLVED] How to connect to internet from command line using nmcli
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 9 of 9
  1. #1
    Join Date
    May 2012
    Location
    Fedora_land
    Posts
    43
    Windows XP Chrome 49.0.2623.112

    How to connect to internet from command line using nmcli

    Hello there

    In fedora 28 i was not getting login screen and instead i was reaching into command line tty where i was able to login.

    To make things worse than I accidentally uninstalled gdm too.

    Now in order to reinstall it, i need to connect to the internet.

    I have LAN connection, that is Ethernet connection with name say eno5.

    Login screen was accessed through: http://10.0.0.4:8090/httpclient.html
    Then i needed to give username: user1 and password: pass1 .

    How to achieve this using nmcli in command line?

    Thank You for your help.
    Last edited by oildonkey; 10th August 2018 at 10:30 AM.
    Tempus fugit et nos fugimus in illus

  2. #2
    Join Date
    Oct 2011
    Posts
    1,865
    Linux Chrome 67.0.3396.87

    Re: How to connect to internet from command line using nmcli

    You should at least know a method you connect to your ISP. Common configuration is a router with a built in modem that connects and maintains an Internet connection for all machines on a local network. In that case you need to login to your router through a web browser interface in order to give it command to connect. Some routers provides command line interface, but that varies between routers and that may be too complicated. There are some command line web browsers, but you would probably need an Internet connection to install them.

    How about using some other device to connect your router to the Internet, like a smartphone.

  3. #3
    Join Date
    May 2012
    Location
    Fedora_land
    Posts
    43
    Windows 8 Chrome 66.0.3359.181

    Re: How to connect to internet from command line using nmcli

    Thank You for the tip srakitnican.

    The connection to computer is through a physical wire from a router which cannot be tinkered with. Smartphone wont connect as my computer does not have builtin WiFi router etc.

    Due to series of unfortunate events i am stuck in tty1 with no gdm, gdm3, no internet connection. I have access to command prompt for my login as well as su.

    Thanks
    Tempus fugit et nos fugimus in illus

  4. #4
    Join Date
    Jun 2004
    Location
    Maryland, US
    Posts
    7,372
    Unknown Firefox 61.0

    Re: How to connect to internet from command line using nmcli

    >Smartphone wont connect as my computer does not have builtin WiFi router etc.

    Not really, you can set your phone to allow "usb tethering"

    Plug the phone to your laptop usb port (needs a microusb to usb cable).
    Then set the phone for USB Tethering
    (for example in my Android "Nougat" 7.1.1, you go to "Settings"-> "Connections" -> "Mobile Hotspot and Tethering" -> check on the "USB tethering" slider,
    the slider will only activate if a usb cable is plugged into a working remote port)

    Activate that interface in your computer as your network and you are online. The last step will likely need a nmcli command in your situation with the missing packages you have lost
    Last edited by marko; 11th August 2018 at 11:39 PM.

  5. #5
    Join Date
    May 2012
    Location
    Fedora_land
    Posts
    43
    Windows 8 Chrome 68.0.3440.106

    Re: How to connect to internet from command line using nmcli

    Thank You Marko.

    It is hard to understand these internet things.

    This looks promising, let me try this.

    Thanks
    Tempus fugit et nos fugimus in illus

  6. #6
    tempest766 Guest

    Re: How to connect to internet from command line using nmcli

    Quote Originally Posted by marko
    >Smartphone wont connect as my computer does not have builtin WiFi router etc.

    Not really, you can set your phone to allow "usb tethering"

    Plug the phone to your laptop usb port (needs a microusb to usb cable).
    Then set the phone for USB Tethering
    (for example in my Android "Nougat" 7.1.1, you go to "Settings"-> "Connections" -> "Mobile Hotspot and Tethering" -> check on the "USB tethering" slider,
    the slider will only activate if a usb cable is plugged into a working remote port)

    Activate that interface in your computer as your network and you are online. The last step will likely need a nmcli command in your situation with the missing packages you have lost

    except that USB tethering is disabled by some wireless providers unless you pay additional for it.

  7. #7
    Join Date
    Jul 2005
    Posts
    914
    Windows NT 10.0 Firefox 61.0

    Re: How to connect to internet from command line using nmcli

    For working with networkmanager from the command line, you could try using nmtui
    You may have to install it, I seem to recall nmtui was not included by default when I last installed a fedora 28 xfce spin and I had to install the NetworkManager-tui package
    ======
    Doug G
    ======

  8. #8
    Join Date
    Aug 2007
    Posts
    270
    Linux Firefox 52.0

    Re: How to connect to internet from command line using nmcli

    To make things worse than I accidentally uninstalled gdm too.
    Have you tried simply entering startx at the command line ? You don't need gdm or any desktop manager to start your GUI. If you still have your X-Window system and your desktop environment ( Gnome or whatever you are using ) installed startx should bring up the GUI. Then you can use the Network Manager GUI.

    Code:
     $ type startx
    startx is /usr/bin/startx
    
    NAME
           startx - initialize an X session
    
    SYNOPSIS
           startx [ [ client ] options ... ] [ -- [ server ] [ display ] options ... ]
    
    DESCRIPTION
           The  startx  script  is  a  front end to xinit(1) that provides a somewhat nicer user interface for running a single session of the X Window System.  It is
           often run with no arguments.

  9. #9
    Join Date
    May 2012
    Location
    Fedora_land
    Posts
    43
    Linux (Fedora) Chrome 67.0.3396.79

    Re: How to connect to internet from command line using nmcli

    Thank You everyone, the problem is now solved.

    @Marko: Yes, these smartphone steps worked just fine. In-fact after following the steps i did not even have to use nmcli command or anything else. I was connected to the internet, i installed gdm and updated everything else and also installed NetworkManager-tui.
    But when i rebooted i again came to tty instead of gui, so i saw that gdm was disabled from this command:

    systemctl status gdm.service

    So i enabled it using the following command:

    systemctl -f enable gdm.service

    I rebooted the computer and the problem is solved. Back from the dead.

    @Doug G: I have installed NetworkManager-tui and will try this.

    @amiga: Unfortunately (rather fortunately) i could not try startx because i already sorted the things before i saw your reply. May be some other day. It sounds interesting.
    Tempus fugit et nos fugimus in illus

Similar Threads

  1. How to connect to network from command line?
    By jcphil in forum Using Fedora
    Replies: 12
    Last Post: 5th December 2013, 08:25 PM
  2. [SOLVED]
    How do you enable the internet connection in the command line?
    By BugRocks1 in forum Using Fedora
    Replies: 10
    Last Post: 21st March 2010, 02:38 PM
  3. Command line way to connect to network?
    By pairajacks in forum Servers & Networking
    Replies: 1
    Last Post: 29th November 2006, 02:48 PM
  4. Internet in KDE but not firefox/yum/command line
    By tornadof3 in forum Using Fedora
    Replies: 2
    Last Post: 9th June 2006, 10:16 AM

Posting Permissions

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