Posted by: isaraffee | September 14, 2009

Configuring IP address using Command line in Ubuntu 9.04 Jaunty

Configuring IP address using Command line in Ubuntu 9.04 Jaunty

root@ismail-laptop:~# ifconfig eth0

eth0 Link encap:Ethernet HWaddr 00:16:d3:43:12:02

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:20 Base address:0xa000

Now let’s configure the eth0 LAN:

root@ismail-laptop:~# ifconfig eth0 172.17.0.2 netmask 255.255.0.0 broadcast 172.17.255.255 up

Notice that we don’t need to restart the network process.

The syslog messages recorded the following:

Aug 23 00:13:57 ismail-laptop avahi-daemon[2583]: Joining mDNS multicast group on interface eth0.IPv4 with address 172.17.0.2.

Aug 23 00:13:57 ismail-laptop avahi-daemon[2583]: New relevant interface eth0.IPv4 for mDNS.

Aug 23 00:13:57 ismail-laptop avahi-daemon[2583]: Registering new address record for 172.17.0.2 on eth0.IPv4

Run the following command:

root@ismail-laptop:~# ip route show

10.64.64.64 dev ppp0 proto kernel scope link src 124.197.72.208

172.17.0.0/16 dev eth0 proto kernel scope link src 172.17.0.2

default dev ppp0 scope link

The output shows the network configuration of ppp0 and eth0. It shows the network and the IP address i.e. 172.17.0.0/16 is the network ID while the 172.17.0.2 is the IP address of eth0.

Let’s now bring down eth0 interface:

root@ismail-laptop:~# ifconfig eth0 down

The /var/log/syslog file recorded the following:

Aug 23 01:06:19 ismail-laptop avahi-daemon[2583]: Interface eth0.IPv4 no longer relevant for mDNS.

Aug 23 01:06:19 ismail-laptop avahi-daemon[2583]: Leaving mDNS multicast group on interface eth0.IPv4 with address 172.17.0.2.

Aug 23 01:06:19 ismail-laptop avahi-daemon[2583]: Withdrawing address record for 172.17.0.2 on eth0.

root@ismail-laptop:/etc/init.d# ifdown eth0

ifdown: interface eth0 not configured

root@ismail-laptop:/etc/init.d# ip route show

10.64.64.64 dev ppp0 proto kernel scope link src 124.197.72.208

default dev ppp0 scope link

root@ismail-laptop:~# ping 172.17.0.2

PING 172.17.0.2 (172.17.0.2) 56(84) bytes of data.

64 bytes from 172.17.0.2: icmp_seq=1 ttl=64 time=0.042 ms

64 bytes from 172.17.0.2: icmp_seq=2 ttl=64 time=0.045 ms

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

Categories

%d bloggers like this: