2:38 AM
3
A. Required Equipment
1. Four PCs (with Linux OS), include PC Gateway. At LabSI, there are 12 PCs, so you can
devide your class to 3 groups.
2. PC’s should be equipped with Network Interface Cards (three PCs with one card but gateway
PC must have 2 ethernet card)
3. One switch
4. One Router with Ethernet interface
5. Cables (UTP Cat 5e or 6)
B. PROCEDURE
1. Setup a physical LAN
a) First, determine which cables are necessary for the available hardware
b) Insert one end of the cable into the Switch and the other end of the cable into the host
computer.
c) Connect all host computers to the Switch as in the figure below

2. Host set-up (e.g. IP address and netmask) using ifconfig
a) ifconfig command usage for this part of the lab will be to configure network interface
devices. This includes adding the IP address and the netmask for the host.
b) Boot each host machine and log on with your user-name.
c) Open a new terminal on each host and log on as root.
$ su -
# password
d) Check network interface settings using ifconfig
# ifconfig –a
e) Verify that eth0 exists on each host by checking the output from above
f) Set the ethernet interface at each host using ifconfig
This will assign an ip address and network mask to the host. The following is a sample.
For host 1: #ifconfig eth0 192.168.1.1 netmask 255.255.255.0
g) Verify communication among the machines by using the ping command.
On host 1 ping the other two hosts.
#ping 192.168.1.2
--------output------
#ping 192.168.1.3
--------output------
On host A run traceroute to the other hosts
#traceroute 192.168.1.2
---------output---------
#traceroute 192.168.1.3
---------output---------
h) Changes using ifconfig at this point are not permanent and will be lost on reboot. To make
the configuration effective on reboot you need to edit the file /etc/sysconfig/networksscripts/
ifcfg-eth0 to have the following settings.
# contents of ifcfg-eth0
DEVICE = eth0
BROADCAST = 192.168.1.255
IPADDR = 192.168.1.1
NETMASK = 255.255.255.0
NETWORK = 192.168.1.0
ONBOOT = yes
BOOTPROTO = none
i) Check that the network script has been added to the default init levels.
# chkconfig --list
j) If the network script is not on add it using chkconfig. This command adds the network
script to the current run level.
# chkconfig --add network
............................................................................................................................................
3. Manipulate routing tables using route
a) The route command is used to look at the hosts routing table and can be used to add or
delete routes from the table. It has the following syntax:
route add|del –net|-host target [gateway] [metric] [device]
route manipulates the kernel's IP routing table. Its primary use is to set up static routes to
specific hosts or networks via an interface after it has been configured with the ifconfig
command. The command route with no arguments displays the routing table.
b) After the steps from part 2 the route to the network 192.168.1.0 will be in the routing
table. Verify the network is in the routing table using the route command.
# route
c) To illustrate the use and functionality of the command route, we will delete an entry and
add an entry to the table. Delete the network 192.168.1.0 using the route command.
# route del –net 192.168.1.0 netmask 255.255.255.0
d) Check the routing table and verify that the network has been removed from the routing
table.
# route
e) Verify the deleted network is no longer reachable.
# ping 192.168.1.3
f) Add individual hosts to the routing table to allow communication.
# route add –host 192.168.1.2 dev eth0
# route add –host 192.168.1.3 dev eth0
g) Verify these hosts are in the routing table.
# route
h) Use the ping command to verify communication among the machines has been restored.
# ping 192.168.1.2
# ping 192.168.1.3
i) Notice the machines were reachable when either the network or the individual host was in the routing table. Note also that the exercise manipulating the routing table was unnecessary since the ifconfig command places the network in the routing table for us.

3 comments:

  1. sudah saya coba min caranya berhasil (h)

    ReplyDelete
  2. sudah saya coba gan caranya
    thx infonya (h)

    ReplyDelete
  3. pertama agak bngung sih tp berhasil kok min (o) thx ya :-d

    ReplyDelete