Results 1 to 6 of 6

Thread: Connect Internet via Terminal

  1. #1
    Join Date
    Jun 2011
    Location
    in my thoughts
    Beans
    19
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Connect Internet via Terminal

    Hi all,
    I want to write a script that would connect to the Internet when it runs so I have to know how to connect the internet via Terminal.
    I've read a lot of posts, threads,....etc over the Internet but nothing could help me
    As mentioned with this thread it solved for him and I tried the same commands but still not solved
    ================================================== =================================
    well, I added the commands here to /etc/network/interfaces:
    Code:
    auto lo iface lo inet loopback  auto wlan0 iface wlan0 inet dhcp wpa-ssid mynetworkname wpa-psk mypassphrase
    but still the problem comes !!
    it shows these messages:
    Code:
    No DHCPOFFERS received.
    Trying recorded lease 192.168.1.100
    PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
    then how could I check if it connected or NOT ??
    Last edited by intelligence storm; January 9th, 2012 at 04:04 PM.

  2. #2
    Join Date
    Jun 2009
    Location
    Staffordshire, UK
    Beans
    30
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Connect Internet via Terminal

    Hello,

    Your system should remember the fact that it is connected to the internet when it boots.

    The questions I need to ask are do you use WiFi, an Ethernet cable, or a USB modem to connect?
    Kris Douglas - IT Systems Manager and Engineer

    ResolveIT - Your Vision. Our Mission.
    Experts in Telecomms, Hardware, Networking and Software.

  3. #3
    Join Date
    Jun 2011
    Location
    in my thoughts
    Beans
    19
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Connect Internet via Terminal

    It's WI-fi connection
    Hmmm.....does that means if the script runs on other computer it does not work ??

  4. #4
    Join Date
    Aug 2005
    Location
    South Carolina, USA
    Beans
    20,567
    Distro
    Ubuntu 14.10 Utopic Unicorn

    Re: Connect Internet via Terminal

    Is the interfaces file correctly formatted?
    Code:
    auto lo
    iface lo inet loopback
    
    auto wlan0 
    iface wlan0 inet dhcp 
    wpa-ssid mynetworkname 
    wpa-psk mypassphrase
    Is Network Manager removed?

    You can check to see if you are really connected with:
    Code:
    ping -c3 www.google.com
    "Oh, Ubuntu, you are my favorite Linux-based operating system" --Dr. Sheldon Cooper, Ph.D.

  5. #5
    Join Date
    Jun 2011
    Location
    in my thoughts
    Beans
    19
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Connect Internet via Terminal

    Network-manger is not removed.
    the format of file is correctly as you mentioned.
    after write :
    Code:
    sudo ifdown wlan0 && sudo ifup wlan0
    it tells:
    Code:
    ifdown: interface wlan0 not configured
    but when type :
    Code:
    sudo ifup wlan0
    it tells:
    Code:
    ifup: interface wlan0 already configured
    !!!
    The end of command run is :
    Code:
    No DHCPOFFERS received.
    Trying recorded lease 192.168.1.100
    PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
    
    --- 192.168.1.1 ping statistics ---
    1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms
    
    No working leases in persistent database - sleeping.

  6. #6
    Join Date
    Aug 2005
    Location
    South Carolina, USA
    Beans
    20,567
    Distro
    Ubuntu 14.10 Utopic Unicorn

    Re: Connect Internet via Terminal

    Network-manger is not removed.
    Manual methods, that is, shell scripts, /etc/network/interfaces, etc. are very unlikely to work correctly as long as NM has a firm grip on your system. I can't do it and I know quite a bit about networking!
    "Oh, Ubuntu, you are my favorite Linux-based operating system" --Dr. Sheldon Cooper, Ph.D.

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
  •