0

I just installed Ubuntu server, but I can't figure out how to connect to the internet, can any one help me? Doing it through Ethernet or WiFi are both available options and please keep in mind I am new to the terminal. Thanks!

1 Answer 1

2

Option1:

if you are working with dhcp

First of all, make sure that your interface is down

sudo ifdown eth0

Now edit the interfaces

sudo nano /etc/network/interfaces

and then add the following lines

auto eth0
iface eth0 inet dhcp

Replace eth0 with the correct number if it's not true.

Now head back , and make interface goes up

sudo ifup eth0

Option2:

For giving static IP.

First of all, make sure that your interface is down

sudo ifdown eth0

Now edit the interfaces file

sudo nano /etc/network/interfaces

and then add the following lines

auto eth0
iface eth0 inet static
    address <IP Address>
    netmask <Network Mask>
    gateway <Default Gateway>

I suppose you know what is Ip,netmask and gateway.

Now for your DNS

sudo nano /etc/resolv.conf

This file should be edited to contain the following lines only

nameserver 208.67.222.222
nameserver 208.67.220.220

Replace the values with yours

Now head back , and make interface goes up

sudo ifup eth0

check this : https://help.ubuntu.com/community/NetworkConfigurationCommandLine/Automatic

5
  • Do I need to need to input the IP, network mask and gateway values and if so how do I get them? Thanks for your help by the way! Feb 10, 2014 at 6:47
  • how are you getting internet? DHCP or you have a static IP ?
    – Maythux
    Feb 10, 2014 at 6:54
  • When I run Ubuntu Desktop and I believe I have DHCP.. Under my Network settings, under the Ipv4 tab it says "Automatic (DHCP)", but that's all I know. Would it be easier to plug into an Ethernet cable? Feb 10, 2014 at 7:01
  • if you have a dhcp then just plug in your cable anddo option 1 in my answer
    – Maythux
    Feb 10, 2014 at 7:03
  • @blenderking you are welcome
    – Maythux
    Feb 11, 2014 at 7:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .