Network Programming Lab Sessions

Network Programming Lab Sessions Log

Network Programming


Session 1:
[root@localhost ~]# cd Desktop

[root@localhost Desktop]# cd ..
[root@localhost ~]# pwd
/root
[root@localhost ~]# ls
123  145  45  anaconda-ks.cfg  delhi  Desktop  india  install.log  install.log.syslog  mp  os  dp  sp  Test.class  Test.java  Test.txt
[root@localhost ~]# rm dp
rm: remove regular file `dp'? y
[root@localhost ~]# ls
123  145  45  anaconda-ks.cfg  delhi  Desktop  india  install.log  install.log.syslog  mp  os  sp  Test.class  Test.java  Test.txt
[root@localhost ~]# nano prat
[root@localhost ~]# cat prat
i am not a nice person


[root@localhost ~]# ll
total 196
-rw-r--r-- 1 root root  2460 Jul 16  2015 123
-rw-r--r-- 1 root root    17 Jul 16  2015 145
-rw-r--r-- 1 root root     0 Jul 16  2015 45
-rw------- 1 root root  4587 Jul 18  2014 anaconda-ks.cfg
-rw-r--r-- 1 root root   174 Jul 16  2015 delhi
drwxr-xr-x 4 root root  4096 Feb 12 14:19 Desktop
-rw-r--r-- 1 root root   221 Jul 16  2015 india
-rw-r--r-- 1 root root 59315 Jul 18  2014 install.log
-rw-r--r-- 1 root root  8740 Jul 18  2014 install.log.syslog
-rw-r--r-- 1 root root    24 Feb 16 13:08 prat
-rw-r--r-- 1 root root    32 Jul 16  2015 mp
-rw-r--r-- 1 root root   285 Jul 16  2015 os
-rw-r--r-- 1 root root    23 Jul 16  2015 sp
-rw-r--r-- 1 root root   413 Feb 11 13:20 Test.class
-rw-r--r-- 1 root root   119 Feb 11 13:20 Test.java
-rw-r--r-- 1 root root   118 Feb 11 13:20 Test.txt
[root@localhost ~]# mkdir dp
[root@localhost ~]# cd dp
[root@localhost dp]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:26:18:5A:88:96 
          inet addr:172.20.113.89  Bcast:172.20.113.255  Mask:255.255.255.0
          inet6 addr: fe80::226:18ff:fe5a:8896/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1736 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1255 errors:0 dropped:0 overruns:0 carrier:1
          collisions:0 txqueuelen:1000
          RX bytes:1606504 (1.5 MiB)  TX bytes:194864 (190.2 KiB)
          Memory:febc0000-fec00000

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:1350 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1350 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4673796 (4.4 MiB)  TX bytes:4673796 (4.4 MiB)

[root@localhost dp]# ping www.google.com
PING www.google.com (216.58.196.4) 56(84) bytes of data.
64 bytes from bom03s05-in-f4.1e100.net (216.58.196.4): icmp_seq=1 ttl=58 time=2.12 ms
64 bytes from bom03s05-in-f4.1e100.net (216.58.196.4): icmp_seq=2 ttl=58 time=2.02 ms
64 bytes from bom03s05-in-f4.1e100.net (216.58.196.4): icmp_seq=3 ttl=58 time=2.04 ms
64 bytes from bom03s05-in-f4.1e100.net (216.58.196.4): icmp_seq=4 ttl=58 time=1.94 ms
^X64 bytes from bom03s05-in-f4.1e100.net (216.58.196.4): icmp_seq=5 ttl=58 time=2.09 ms
64 bytes from bom03s05-in-f4.1e100.net (216.58.196.4): icmp_seq=6 ttl=58 time=2.21 ms

--- www.google.com ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5001ms
rtt min/avg/max/mdev = 1.940/2.074/2.218/0.093 ms

[root@localhost dp]# tracert www.google.com
traceroute to www.google.com (216.58.196.4), 30 hops max, 40 byte packets
 1  172.20.113.1 (172.20.113.1)  0.433 ms  0.419 ms  0.615 ms
 2  5.5.5.134 (5.5.5.134)  1.249 ms * *
 3  * 172.16.27.97 (172.16.27.97)  3.251 ms  3.247 ms
 4  sw01.bb.hns.net.in (123.108.224.22)  2.181 ms  2.402 ms  2.398 ms
 5  sw01-gw.bb.hns.net.in (123.108.224.21)  3.431 ms  3.631 ms  3.626 ms
 6  72.14.195.64 (72.14.195.64)  2.797 ms  1.822 ms  2.177 ms
 7  209.85.254.138 (209.85.254.138)  27.324 ms  1.917 ms  1.890 ms
 8  216.239.41.149 (216.239.41.149)  2.288 ms  2.688 ms  2.681 ms
 9  bom03s05-in-f4.1e100.net (216.58.196.4)  2.673 ms  2.666 ms  2.659 ms


[root@localhost dp]# nslookup www.googlewww.google.com
Server:         172.20.113.1
Address:        172.20.113.1#53


[root@localhost dp]# nslookup www.ijser.org
Server:         172.20.113.1
Address:        172.20.113.1#53

Non-authoritative answer:
Name:   www.ijser.org
Address: 208.115.232.91

 [root@localhost dp]# arp
Address                  HWtype  HWaddress           Flags Mask            Iface
172.20.113.1             ether   00:90:FB:53:B6:E4   C                     eth0



Session 2:

[root@localhost ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:26:18:5A:88:55 
          inet addr:172.20.113.88  Bcast:172.20.113.255  Mask:255.255.255.0
          inet6 addr: fe80::226:18ff:fe5a:8855/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:327 errors:0 dropped:0 overruns:0 frame:0
          TX packets:59 errors:0 dropped:0 overruns:0 carrier:1
          collisions:0 txqueuelen:1000
          RX bytes:30563 (29.8 KiB)  TX bytes:10419 (10.1 KiB)
          Memory:febc0000-fec00000

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:1521 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1521 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4616560 (4.4 MiB)  TX bytes:4616560 (4.4 MiB)

[root@localhost ~]# ifconfig eth0 144.33.22.56 netmask 255.255.0.0
[root@localhost ~]# ifconfig eth0 144.33.22.56 netmask 255.255.0.0 up
[root@localhost ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:26:18:5A:88:55 
          inet addr:144.33.22.56  Bcast:144.33.255.255  Mask:255.255.0.0
          inet6 addr: fe80::226:18ff:fe5a:8855/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:361 errors:0 dropped:0 overruns:0 frame:0
          TX packets:71 errors:0 dropped:0 overruns:0 carrier:1
          collisions:0 txqueuelen:1000
          RX bytes:33501 (32.7 KiB)  TX bytes:12925 (12.6 KiB)
          Memory:febc0000-fec00000

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:1521 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1521 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4616560 (4.4 MiB)  TX bytes:4616560 (4.4 MiB)

[root@localhost ~]# ifconfig eth0 144.33.22.56 netmask 255.255.0.0 down


[root@localhost ~]# service network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0: 
Determining IP information for eth0... done.
                                                           [  OK  ]
[root@localhost ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:26:18:5A:88:55 
          inet addr:172.20.113.88  Bcast:172.20.113.255  Mask:255.255.255.0
          inet6 addr: fe80::226:18ff:fe5a:8855/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:406 errors:0 dropped:0 overruns:0 frame:0
          TX packets:122 errors:0 dropped:0 overruns:0 carrier:1
          collisions:0 txqueuelen:1000
          RX bytes:37298 (36.4 KiB)  TX bytes:23491 (22.9 KiB)
          Memory:febc0000-fec00000

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:1521 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1521 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4616560 (4.4 MiB)  TX bytes:4616560 (4.4 MiB)

[root@localhost ~]#  cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# ls
backup.ifconfigeth0  ifdown-bnep   ifdown-ipv6  ifdown-routes  ifup          ifup-ib     ifup-ipx    ifup-post    ifup-sl           net.hotplug
ifcfg-eth0           ifdown-eth    ifdown-isdn  ifdown-sit     ifup-aliases  ifup-ippp   ifup-isdn   ifup-ppp     ifup-tunnel       network-functions
ifcfg-lo             ifdown-ippp   ifdown-post  ifdown-sl      ifup-bnep     ifup-ipsec  ifup-plip   ifup-routes  ifup-wireless     network-functions-ipv6
ifdown               ifdown-ipsec  ifdown-ppp   ifdown-tunnel  ifup-eth      ifup-ipv6   ifup-plusb  ifup-sit     init.ipv6-global
[root@localhost network-scripts]# cat ifcfg-eth0
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
TYPE=Ethernet
DEVICE=eth0
#HWADDR=00:26:18:5a:88:95 # Commented by Clonezilla
BOOTPROTO=dhcp
ONBOOT=yes
USERCTL=no
IPV6INIT=no
PEERDNS=yes
[root@localhost network-scripts]# nano ifcfg-eth0
[root@localhost network-scripts]# cat ifcfg-eth0
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
TYPE=Ethernet
DEVICE=eth0
#HWADDR=00:26:18:5a:88:95 # Commented by Clonezilla
IPADDR=192.168.12.52
NETMASK=255.255.0.0
BOOTPROTO=static
ONBOOT=yes
USERCTL=no
IPV6INIT=no
PEERDNS=yes

[root@localhost network-scripts]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:26:18:5A:88:55 
          inet addr:192.168.12.52  Bcast:192.168.255.255  Mask:255.255.0.0
          inet6 addr: fe80::226:18ff:fe5a:8855/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1495 errors:0 dropped:0 overruns:0 frame:0
          TX packets:693 errors:0 dropped:0 overruns:0 carrier:1
          collisions:0 txqueuelen:1000
          RX bytes:706423 (689.8 KiB)  TX bytes:125176 (122.2 KiB)
          Memory:febc0000-fec00000





[root@localhost network-scripts]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:26:18:5A:88:55 
          inet addr:144.22.33.5  Bcast:144.22.255.255  Mask:255.255.0.0
          inet6 addr: fe80::226:18ff:fe5a:8855/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1905 errors:0 dropped:0 overruns:0 frame:0
          TX packets:731 errors:0 dropped:0 overruns:0 carrier:1
          collisions:0 txqueuelen:1000
          RX bytes:741280 (723.9 KiB)  TX bytes:130940 (127.8 KiB)
          Memory:febc0000-fec00000






 [root@localhost network-scripts]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:26:18:5A:88:55 
          inet addr:192.168.12.52  Bcast:192.168.255.255  Mask:255.255.0.0
          inet6 addr: fe80::226:18ff:fe5a:8855/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1874 errors:0 dropped:0 overruns:0 frame:0
          TX packets:709 errors:0 dropped:0 overruns:0 carrier:1
          collisions:0 txqueuelen:1000
          RX bytes:737820 (720.5 KiB)  TX bytes:126708 (123.7 KiB)
          Memory:febc0000-fec00000

[root@localhost network-scripts]# service network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:                                [  OK  ]
[root@localhost network-scripts]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:26:18:5A:88:55 
          inet addr:144.22.33.5  Bcast:144.22.255.255  Mask:255.255.0.0
          inet6 addr: fe80::226:18ff:fe5a:8855/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1905 errors:0 dropped:0 overruns:0 frame:0
          TX packets:731 errors:0 dropped:0 overruns:0 carrier:1
          collisions:0 txqueuelen:1000
          RX bytes:741280 (723.9 KiB)  TX bytes:130940 (127.8 KiB)
          Memory:febc0000-fec00000



[root@localhost network-scripts]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:26:18:5A:88:55 
          inet addr:172.20.113.88  Bcast:172.20.113.255  Mask:255.255.255.0
          inet6 addr: fe80::226:18ff:fe5a:8855/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2135 errors:0 dropped:0 overruns:0 frame:0
          TX packets:755 errors:0 dropped:0 overruns:0 carrier:1
          collisions:0 txqueuelen:1000
          RX bytes:761706 (743.8 KiB)  TX bytes:135528 (132.3 KiB)
          Memory:febc0000-fec00000

Comments

Popular posts from this blog

Intermediate Code Generation > C Program