How to configure network using CLI ang GUI in Ubuntu 12.04

.

In this example I will show how to setup network configuration using command line and graphical tool in Ubuntu 12.04. To start accessing internet or sharing other resources on the network you have to configure TCP/IP settings of you ethernet card. In ubuntu you can configure network settings through GUI and CLI. It can be a difficult task for newbie user who is switching from other OS to ubuntu as the look and feel of ubuntu will be different in comparison of other OS (specifically windows). In this tutorial we will be seeing how to configure TCP/IP setting via GUI as well as CLI.

Before starting the configuration part, you have to know whether you will be configuring IP manually or IP will be assigned directly through DHCP server.

In case of manual IP assignment you should know IP address, subnet mask, gateway and DNS. In this tutorial I am using following information. Remember you don’t require it in case of DHCP configuration.

IP : 192.168.1.100
NETMASK : 255.255.255.0
GATEWAY : 192.168.1.1
BROADCAST : 192.168.1.255
NETWORK : 192.168.1.0
DNS : 8.8.8.8

Method 1 : Configure network GUI mode

Step 1 : First find out the network interface to configure. Open a terminal and run ifconfig

ifconfig

Result will be something similar to below screenshot.

ubuntu network cli 1 How to configure network using CLI ang GUI in Ubuntu 12.04

Step 2 : We will be assigning IP address to eth0 adapter. To do the same Click on “System Setting” and select “Network”

ubuntu network gui 1 How to configure network using CLI ang GUI in Ubuntu 12.04

ubuntu network gui 2 How to configure network using CLI ang GUI in Ubuntu 12.04

Step 3 : As eth0 is wired connection click on “wired”. Choose “ON” option and click on “Configure” button.

ubuntu network gui 3 How to configure network using CLI ang GUI in Ubuntu 12.04

Step 4 : Go to “IPv4 Settings” tab. In case of DHCP / Automatic configuration choose “Automatic (DHCP)” option in “method”

ubuntu network gui 4 How to configure network using CLI ang GUI in Ubuntu 12.04

In case of manual configuration select “Manual” option in “method”. Click on “Add” button. Enter IP Address, netmask and gateway information. Also enter DNS Server. In this example I am using google DNS server’s IP.
ubuntu network gui 5 How to configure network using CLI ang GUI in Ubuntu 12.04

After finishing it up click on “Save” button.

To confirm the setting again run “ifconfig” command and check the “eth0″ interface settings. In case of successful configuration you will see something like below screenshot.
ubuntu network gui 6 How to configure network using CLI ang GUI in Ubuntu 12.04

Method 2 : Configure network CLI Mode

Step 1 : First find out the network interface to configure. Open a terminal and run ifconfig

ifconfig

Result will be something similar to below screenshot.

ubuntu network cli 1 How to configure network using CLI ang GUI in Ubuntu 12.04

Step 2 : We will be assigning IP address to eth0 adapter. Open a terminal and type

sudo vi /etc/network/interfaces

ubuntu network cli 2 How to configure network using CLI ang GUI in Ubuntu 12.04

ubuntu network cli 3 How to configure network using CLI ang GUI in Ubuntu 12.04

Step 3 : Now you need to add eth0 information in this file.
In case of DHCP / Automatic IP assignment enter following line and save this file.

iface eth0 inet dhcp

In case of manual IP assignment enter following line and save this file.

iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

ubuntu network cli 4 How to configure network using CLI ang GUI in Ubuntu 12.04

To configure DNS, enter following command. Remember to run it through “root” user

echo “nameserver 8.8.8.8″ >> /etc/resolve.conf

Step 4 : Now run following command to start eth0 interface

sudo ifup eth0

ubuntu network cli 5 How to configure network using CLI ang GUI in Ubuntu 12.04

Step 5: To confirm the setting again run “ifconfig” command and check the “eth0″ interface settings. In case of successful configuration you will see something like below screenshot.

ubuntu network gui 6 How to configure network using CLI ang GUI in Ubuntu 12.04

Hope that would be helpful for you.

Source

 How to configure network using CLI ang GUI in Ubuntu 12.04

About Sheikh Khalid

Sheikh Khalid has written 16 post in this blog.

Systems Engineer at Cisco Australia.

Incoming search terms:

Be Sociable, Share!
  • more How to configure network using CLI ang GUI in Ubuntu 12.04

    You can leave a response, or trackback from your own site.

    Leave a Reply


    + 1 = seven

    Powered by WordPress | Designed by: best suv | Thanks to trucks, infiniti suv and toyota suv
    show
     
    close
    Email
    Print
    WP Socializer Aakash Web
    promotepoint's Profile on Ping.sg