How To Wiki
Advertisement

Internet access in Linux

Howtos and solutions[]

When you don't have the configuration (ip addresses)[]

Requirements[]

how to access beam internet in linux (wired)

Steps[]

Often, when you don't have any information provided by your internet provider, it means that the computer retrieves the ip addresses using a DHCP client. If this is true, you can try to get the ip addresses by typing :

dhclient eth0

or

dhcpcd eth0

When you have the configuration (ip addresses)[]

Requirements[]

This solution supposes that your internet provider has given you

  • an ip address that we call iii.iii.iii.iii
  • a network netmask that we call nnn.nnn.nnn.nnn
  • an ip for the gateway that we call ggg.ggg.ggg.ggg
  • one ore more DNS ip that we call dn1.dn1.dn1.dn1 or dn2.dn2.dn2.dn2 supposing that you have 2 DNS servers

This also supposes that you connect to internet using an ethernet card and that your cable is plugged into the eth0 ethernet card.

Steps[]

Login as a normal user; after that, become root by typing su and after that the root password. Type the following :

/sbin/ifconfig eth0 iii.iii.iii.iii netmask nnn.nnn.nnn.nnn
/sbin/route add default gw ggg.ggg.ggg.ggg
echo "nameserver dn1.dn1.dn1.dn1" > /etc/resolv.conf 
echo "nameserver dn2.dn2.dn2.dn2" >> /etc/resolv.conf


Testing the internet connection[]

You can test the internet connection by pinging an internet website; for example you can type :

ping gnu.org

and you should see :

PING gnu.org (199.232.41.10) 56(84) bytes of data.
64 bytes from www.gnu.org (199.232.41.10): icmp_seq=1 ttl=51 time=230 ms
64 bytes from www.gnu.org (199.232.41.10): icmp_seq=2 ttl=51 time=227 ms
64 bytes from www.gnu.org (199.232.41.10): icmp_seq=5 ttl=51 time=242 ms
From HowTo Wiki, a Wikia wiki.
Advertisement