We
start the computer in text mode and login as root:
Log
in as root user
log
in: root
password:
rootuser
Command
to configure network cards are:
# linuxconf
Thereafter
go to
Config>
Networking > Client Tasks > Basic Host Information
We type in hostname and IP address.
In the Net device field, we
type eth0 (is the first
Ethernet card).
In Kernel module field, we
type 3c509 for 3Com 3c509
series Ethernet cards, or type 3c59x
for 3Com 3c905 series. On PC2, we do the same for the second Ethernet
card (eth1).
Finally,
we select Activate the changes and logout.
We
check Ethernet card with command
ifconfig eth0
·
ifconfig eth1 (PC2 only)
Result
of commands:
[root@localhost root]# ifconfig eth0
eth0
link encap: Ethnet
Hwaddr: 00:01:02:0B:F5:D
inet
addr: 192.168.13.1
Bcast:
192.168.13.255
Net mask: 255.255.255.0
UP BROADCAST
RUNNING MTU:
1500
METRIC: 1
RX packets:
5 error:
0 dropped: 0
overruns: 0
fame: 0
TX packets: 26
error: 0
dropped: 0
overruns: 0 carrier: 0
Collisions: 0
RX bytes: 414 (414.0 b) TX
bytes: 7178 (7.0 kb)
[root@localhost
root]# ifconfig eth1
eth1
link encap: Ethernet
Hwaddr: 00:01:02:0B:F5:D3
inet
addr: 192.168.33.1
Bcast:
192.168.33.255
Net mask:
255.255.255.0
UP BROADCAST
RUNNING MULTICAST MTU: 1500
METRIC: 1
RX packets:
5 error:
0 dropped: 0
overruns: 0 fame:
0
TX packets:
9 error:
0 dropped: 0
overruns: 0 carrier:
0
Collisions: 0
RX bytes: 414 (414.0 b) TX
bytes: 654 (654. 0 b)
Command to check
the all active network cards is ifconfig,
we write down the results as
below:
[root@localhost
root]# ifconfig
eth0
link encap:
Ethnet Hwaddr:
00:01:02:0B:F5:D3
inet
addr: 192.168.13.1
Bcast:
192.168.13.255
Net
mask: 255.255.255.0
UP BROADCAST
RUNNING MTU:
1500
METRIC: 1
RX packets:
5 error:
0 dropped: 0
overruns: 0
fame: 0
TX packets: 26
error: 0
dropped: 0
overruns: 0 carrier: 0
Collisions: 0
RX bytes: 414 (414.0 b)
TX bytes: 7178 (7.0 kb)
eth1
link encap:
Ethernet Hwaddr:
00:01:02:0B:F5:D3
inet addr: 192.168.33.1
Bcast:
192.168.33.255
Net
mask: 255.255.255.0
UP BROADCAST
RUNNING MULTICAST MTU: 1500
METRIC: 1
RX packets:
5 error:
0 dropped:
0 overruns: 0
fame: 0
TX packets:
9 error:
0 dropped: 0
overruns: 0 carrier:
0
Collisions: 0
RX bytes: 414 (414.0 b)
TX bytes: 654 (654. 0 b)
lo
ink
encap: local loopback
inet addr:
127.0.0.1 Mask:
255.0.0.0
UP LOOP BACK
RUNNING MTU: 16436 METRIC:
RX packets:
20 error: 0
dropped: 0
overruns: 0
fame: 0
TX packets:
20 error:
0 dropped: 0
overruns: 0 carrier:
0
Collisions: 0
RX bytes: 1416 (1.3 kb)
TX bytes: 1416 (1.3 kb)
Use
“pico” to append
following lines in file “/etc/hosts”
on PC1, PC2and PC3.
[root@localhost root]# pico /etc/hosts
On PC1:
192.168.13.2
pc1.telecommx.sbu.ac.uk
pc1
192.168.13.1
pc2.telecommx.sbu.ac.uk
pc2
192.168.33.2
pc3.telecommx.sbu.ac.uk
pc3
On
PC2:
192.168.13.2
pc1.telecommx.sbu.ac.uk
pc1
192.168.33.2
pc3.telecommx.sbu.ac.uk
pc3
On
PC3:
192.168.13.2
pc1.telecommx.sbu.ac.uk
pc1
192.168.33.1
pc2.telecommx.sbu.ac.uk
pc2
192.168.33.2
pc3.telecommx.sbu.ac.uk
pc3
Commands:
ping
127.0.0.1
ping
localhost
ping
pc1
(where pc1 is our hostname)
ping
pc3
(where pc3 is our hostname)
ping
192.168.y.z
(where 192.168.y.z is our neighbour PC’s IP address)
Command
to bring up the Ethernet cards:
ifconfig
eth0 up
ifconfig
eth1 up
(PC2 only)
If
this not work, try the below:
ifconfig
eth0 inet
192.168.y.z netmask
255.255.255.0 up
ifconfig eth1
ine
192.168.yy.zz
netmask 255.255.255.0
up (PC2 only)
Repeat
steps 4 and 5.
To
check system information, run following commands:
cat
/etc/sysconfig/network
(Network
information)
cat
/etc/hosts
(Host information)
cat
/etc/sysconfig/network-scripts/ifcfg-eth0 (Network
card information)
cat
/etc/services
(Network
services information)
cat
/etc/resolv.conf
(Name Server
information)
Alternatively,
you can also use following commands to get current system information.
hostname
uname
uname
-a
To
stop, start and restart the network,
/etc/rc.d/init.d/network stop
/etc/rc.d/init.d/network start
/etc/rc.d/init.d/network restart
To bring down the Ethernet
cards
ifconfig
eth0 down
ifconfig
eth1 down
(PC2 only)
Questions and
answer:
1.
What is the localhost?
Answer:
As
I understand, when say localhost in our studies, it obvious talking
about computers based networking system that is consists of hardware
networks, files, devices and other resources at one’s main workstation
area, and that also mean device such as computers network accessed
directly without the use of a telecommunication line. Such system of
computers based Linux networking in the Lab at South Bank University is
a truly localhost networking system.
2.
What is loopback address? What is the range of loopback addresses?
Answer:
Loopback address
certainly is an address used for communications between clients and
servers that reside on the same host, for example, at the above when we
use the command [root@localhost root]# ifconfig
it has
showed up a local loopback address: 127.0.0.1
3.
What type of addresses are 192.168.*.*?
Answer:
With
no doubt to answer that the type of addresses that are 192.168.*.* are
certainly identified as and IP address of internet and networking device
and routing such as Ethernet cards IP address associated with the use of
software address which consist of a network portion and a host portion,
so that the partition make routing become efficient.
4.
What is the purpose of file /etc/hosts?
Answer:
The
purpose of /etc/hosts file command is to bring up the information of hosts IP
addresses computers system based networking in order to add others IP
addresses so that they can join together simultaneously.
5.
Use Linux man pages to write a short introduction on how to use ifconfig
and ping?
Answer:
The
ifconfig command is help to display an active network interface and also
be use to configure net work interface and scripts as the same time with
the man command can send out short information and message fast and also
at there can receive other messages which send back to instantly, in
that sense so that the exchange information can be in speed and
configure each others to ping correctly IP addresses.
End.
|