My personal blog around GNU/Linux


Sometimes we may need to configure the Internet Protocol Address Manually in order to establish the connection with the Server.
Here in this article post i will show how to set or change the IP address for your system via Terminal.

Step 1: Open Terminal. In Ubuntu ( Applications -> Accessories -> Terminal )

Step 2: Type the following command to check if any IP is assigned to your system automatically.

Command$: ifconfig

The above command will dispaly output something like this

eth0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:40 Base address:0x1000

lo      Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:56144 errors:0 dropped:0 overruns:0 frame:0
TX packets:56144 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:35563073 (35.5 MB) TX bytes:35563073 (35.5 MB)

Step 3: In the above output, in eht0 we cannot find ‘inet addr’ field, which means that no IP address is assigned.

Step 4: Now in the below command I will show how to assign the IP address.

Command$: ifconfig eth0 201.222.255.1 netmask 255.255.255.0

Note: I have used a random IP. You have to use the ip which you desire to use.

Step 5: In order to check whether the IP has been set or changed. Again run the command ‘ifconfig‘.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: