ifup eth0: unknown host

11,330

Remount root read-write:

mount -o remount,rw /

This is so you can edit files under /etc/.

Edit /etc/network/interfaces

Add:

auto enp0s2
iface enp0s2 inet dhcp

Run: ifup enp0s2

It is 'enp0s2' and not 'eth0' because of kernel modifications that were added to support Predictable Network Interface Names

Share:
11,330

Related videos on Youtube

b-boy
Author by

b-boy

Updated on September 18, 2022

Comments

  • b-boy
    b-boy over 1 year

    unfortunately, i am in Ubuntu Recovery Mode.
    I need Internet connection but, i fail to bring it up.

    $ ifconfig
    enp0s2  Link encap:Ethernet HWaddr xxxx
            inet addr:
            inet6 addr:
           ...
    lo      Link encap:local
           ...
    
    $ sudo ifup enp0s2
    Ignoring unknown interface enp0s2=enp0s2
    
    $ sudo ifconfig up enp0s2
    enp0s2: Unknown host
    

    The router has connection to the Internet and the laptop is proper connected via cable.

    So, why nobody loves me?
    And, how do i bring Ethernet up?

    BTW: why is it 'enp0s2' and not 'eth0' as usual?

  • b-boy
    b-boy about 8 years
    Nice. 'ifup' works now. But, still i can't 'ping google.com'. It says 'unknown host'.
  • Acceptable Name
    Acceptable Name about 8 years
    Edit /etc/resolv.conf add nameserver 8.8.4.4
  • b-boy
    b-boy about 8 years
    Nope. ping still aint working. Although, i didnt restart anything.
  • Acceptable Name
    Acceptable Name about 8 years
    Does ping -n 8.8.4.4 work?
  • b-boy
    b-boy about 8 years
    $ ping -n 8.8.4.4 connect: Network is unreachable
  • b-boy
    b-boy about 8 years
    Sorry, my bad. A typo in /etc/network/interfaces. Works now. (Although, one question from the initial post still unanswered...)
  • Acceptable Name
    Acceptable Name about 8 years
    Nobody loves you because you don't understand what love is. If you understood what love is you would realize how much you are loved.
  • pivanchy
    pivanchy over 7 years
    @MettaCrawler, will this solution work, if I want to enable eth0? And what is the reason of remounting root?