Ccna 1 - 49
Ccna 1 - 49
What is a Network?
There are many types of networks that provide us with different kinds of services. In the course of a
day, a person might make a phone call, watch a television show, listen to the radio, look up something
on the Internet, or even play a video game with someone in another country. All of these activities
depend on robust, reliable networks. Networks provide the ability to connect people and equipment no
matter where they are in the world. People use networks without ever thinking about how they work
or what it would be like if the networks did not exist.
What is a Network?
Communication technology in the 1990s, and before, required separate, dedicated networks for voice,
video and computer data communications. Each of these networks required a different type of device
in order to access the network. Telephones, televisions, and computers used specific technologies and
different dedicated network structures, to communicate. But what if people want to access all of these
network services at the same time, possibly using a single device?
New technologies create a new kind of network that delivers more than a single type of service.
Unlike dedicated networks, these new converged networks are capable of delivering voice, video and
data services over the same communication channel or network structure.
New products are coming to market that take advantage of the capabilities of converged information
networks. People can now watch live video broadcasts on their computers, make a telephone call over
the Internet, or search the Internet using a television. Converged networks make this possible.
Benefits of Networking
Networks come in all sizes. They can range from simple networks consisting of two computers, to
networks connecting millions of devices. Networks installed in small offices, or homes and home
offices, are referred to as SOHO networks. SOHO networks enable sharing of resources, such as
printers, documents, pictures and music between a few local computers.
1
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
In business, large networks can be used to advertise and sell products, order supplies, and
communicate with customers. Communication over a network is usually more efficient and less
expensive than traditional forms of communication, such as regular mail or long distance phone calls.
Networks allow for rapid communication such as email and instant messaging, and provide
consolidation, storage, and access to information on network servers.
Business and SOHO networks usually provide a shared connection to the Internet. The Internet is
considered a "network of networks" because it is literally made up of thousands of networks that are
connected to each other.
Hosts
Shared peripherals
Networking devices
Networking media
The network components that people are most familiar with are hosts and shared peripherals. Hosts
are devices that send and receive messages directly across the network.
Shared peripherals are not directly connected to the network, but instead are connected to hosts. The
host is then responsible for sharing the peripheral across the network. Hosts have computer software
configured to enable people on the network to use the attached peripheral devices.
The network devices, as well as networking media, are used to interconnect hosts.
Some devices can play more than one role, depending on how they are connected. For example, a
printer directly connected to a host (local printer) is a peripheral. A printer directly connected to a
network device and participates directly in network communications is a host.
A Simple Similie
2
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Hub - Think of a postman with a letter to deliver in a row of houses, none of
the houses have numbers so he has to visit each house and ask the owner if the
letter is for them.
Switch - All the houses are numbered, so the postman knows where to go, and
doesn't have to bother any other home owners.
2. What is deference between Switch and repeater
3. MAC is stand for what
Answer:
A Mac address is short for media access control address. It is used to identify
a computer on a network
4. Explain the range of private IP addresses
Answer:
Private IP address ranges
10.0.0.0 - 10.255.255.255
Addresses: 16,777,216
172.16.0.0 - 172.31.255.255
Addresses: 1,048,576
192.168.0.0 - 192.168.255.255
Addresses: 65,536
5. What is NIRA
Answer:
NIRA
National Internet Registry of Afghanistan (NIRA) is not-for-profit,
Government organization responsible for providing the service of allocating
and registering Internet resources in Afghanistan.
6. What is network
A network consists of two or more computers that are linked in order to share
resources (such as printers and CDs), exchange files, or allow electronic
communications. The computers on a network may be linked through cables,
telephone lines, radio waves, satellites, or infrared light beams
7. Why we use the computer network
File sharing
E-mail
E-business
E-Learning
Printer Sharing
Centralized Administration & Support
Remote Access
8. Network is divided in to how many parts
In public network divided in 2 Parts
-geographical area
-Network component
9. What is bandwidth
3
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Bandwidth is the amount of space that is used to transfer data and information through the Internet.
Bandwidth may also refer to the amount of space a person has for their own website and data
10. What is through put
The quantity or amount of raw material processed within a given time, esp. the work done by an
electronic computer in a given period of time
11. Where do we use the router
A router is specialized computer connected to more than one network. A router runs
software that allows the device to move data from one network to another. Routers operate
at the network layer (OSI Model's layer 3).
4
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
21. What is a Network
Answer before
22. Why use a Computer Network
Answer before
23. Categories of LAN Network
There are 2 categories of network
Peer to Peer Network
Client Server Network
IP address
Class Rang Default subnet mask Network(N) and host(H) parts
Class A 1--- 126 255.0.0.0 N.H.H.H
Class B 128--- 191 255.255.0.0 N.N.H.H
Class c 192---223 255.255.255.255.0 N.N.N.H
Class D 224---239 Reserved for multicast
Class E 140---255 Reserved for experimental ,used for research
IP Address
. بوجود آمدISO آدرس توسطIP هاComputer برای اولین باربرای شناختن
IP address (IPV4)
دارایIP Address میباشد که هر32bit دارایIP Address میباشد که هرIP عبارت ازIPV4
. میباشد8bit ما دارایoctet که هر4octed
IPV4 = 32bi t= 4 octet
1octed = 8bit
IP Address are divided in two parts
. قابل تغییر نمیباشدIP این بخش ازis no changeable :Network ID )1
. (0—255) قابل تغییر میباشدIP این بخشis changeable :Host ID )2
استفاده میگرددNIC مشاهیده نمیشود دراین صورت آن برای چک نمودن127 Class A در
هایSIGNAL عبارت از وسیله میباشد کهNIC . درکمبیوتر درست است ویا نهNIC که آیا
. یاد میگرددloopback تبدیل میکند که بنامDigital را بهAnalog وAnalog بهDigital
. رفته دستور ذیل را نوشته نمایدrun در
5
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Run>cmd>nslookup
اگر 127را نشان داد دراین صورت NICما مشکل ندارد درصورت خراب بودن شبکه
مشکل در جاهای دیگری میباشد مانند کیبل و یا دیگر وسایل شبکه میباشد.
Classهای C,B,Aدرشبکه های internetفعلی در جهان مورد استفاده قرار میگیرد و
classهای E,Dبرای تحقیقات و researchمورد استفاده قرار میگیرد.
Kinds of IP addresses
:Private IP addressesعبارت از آدرس های میباشد که تکرار میگردد ودرشبکه های محلی مورد
استفاده قرارمیگیرد وضرورت به راجستر نمودن نمیباشد.
:Public IP addressesعبارت از آدرس های میباشد که تکرار نمیگردد وهمچنان باید این نوع
آدرس ها باید راجستر شود درغیر آن کارنمیکند.
Publicآدرس ها را کی راجستر میکند؟
برای باراول اگر کدام کمپنی بیخواهد internetبیگیرد اول میرود به ISPکه یکی از ارایه کنندگان
internetمیباشد بعد آن به NIRAکه اداره ملی راجستر نمودن internetدرکشورما افغانستان
میباشد وآن میرود به APNICکه عبارت ازاداره کنترول نمودن internetدرسطح آسیا میباشد وبعد
ازآن میرود به ICANکه اداره کنترول نمودن internetدر تمام جهان میباشد بعد از این همه این
مراحل به آن internetارایه میگردد یعنی یک IP addressمیدهد.
ISP => Internet Service Provider.
NIRA =>National Internet Registry of Afghanistan.
APNIC => Asia Pacific Network Information Center.
ICANN => Internet Corporation for Assigned Names and Numbers.
معلوم نمودن IPکه آیا privateمیباشد ویا public
اگراعداد ذیل درآغاز یک IPبود بدانید که آن Privateمیباشد درآن صورت به هیچ صورت public
شده نمیتواند.
Class A 10.0.0.0 TO 10.255.255.255
Class B 172.16.0.0 TO 172.31.255.255
Class C 192.168.0.0 TO 192.168.255.255
توسط این ویب سایت میتوانیم بیدانیم که آیا Privateمیباشد ویا :public
www.whatismyipaddress.com
?What is subnet mask
Subnet maskفیصله میکند که کدام بخش از IPآدرس مربوط به networkو کدام بخش آن مربوط
به hostمیگردد.
6
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Class A 255.0.0.0 N.H.H.H
Class B 255.255.0.0 N.N.H.H
Class C 255.255.255.0 N.N.N.H
Subneting
چرا ما به subnetingمیرویم چی ضرورت است ما و شما subnetingرا انجام دهیم وهمین IP
آدرس ها را چرا subnetمیکنیم و خود subnetچی میباشد اصال subnetو subnetingیک
پروسه میباشد که توسط آن پروسه IPآدرس ها به بخش ها تقسیم بندی میکنیم وتوسط آن میتوانیم IP
های که دریک شبکه مزاهمت میکند و ازدهام ترافیک به وجود میاورد Broadcastبه وجود میاورد
میخواهیم آن آدرسها را ازلیست بیرون میکشیم توسط subnetingاین کار راانجام میدهیم.
چی ضرورت است که subnetingبه وجود میآوریم بخاطراین به وجود میآوریم که اگرما وشما این
رابیخواهیم دریک دفتر دوهزار مامورین داریم میخواهیم برای دوهزار clientباید internetتوزیع
کنیم در آن صورت ضرورت به subnetingداریم و یک یک پروسه تقسیم بندی IPآدرس ها میباشد
که IPرا به بخش های مختلف تقسیم بندی میکنیم بخاطریکه زیاد USERرا supportکند
ودیگرIPآدرس های مزاهم را ازلیست بیرون کنیم پس مت ضرورت به Subnetingداریم یا این همه
کار های را انجام دهیم و این یکی از مسایل مهم واساسی وظایف مدیران ITمیباشد.
طریقه دانستن اینکه دریک classچند userرا supportکرده میتوانیم که با استفاده ازفورمول ذیل
میتوان دریافت.
?= 2h- 2
Class A 0 -- 126 224- 2 =16777214 user
Class B 128 -- 191 216- 2 =65534 user
Class C 192-- 223 28-2 =254 user
قبل از Subnetingباید تبدیل نمودن binaryرا به decimalرا یادداشته باشیم باید بیداند binary
وdecimalچی میباشد.
7
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
مثال1.1.1.1 :۱
128 64 32 16 8 4 2 1
0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 1
1.1.1.1 = 00000001.00000001.00000001.00000001
مثال192.168.1.1 :۲
128 64 32 16 8 4 2 1
1 1 0 0 0 0 0 0
1 0 1 0 1 0 0 0
0 0 0 0 0 0 1
0 0 0 0 0 0 0 1
191.168.1.1 = 11000000.10101000.00000001.00000001
هر IPکه اخیر آن صفر باشدآن عبارت از IPمربوط به networkمیباشد .اولین بخش یک IPبنام
Network idبخش اخیر آن را بنام broadcast idوبخش بین network idو broadcast idرا
بنام host idیادمیگردد.بخش networkو broadcastقابل استفاده نمیباشد اما بخش hostقابل
استفاده میباشد.درهر classتا اندازه های ذیل bitقرض میتوانیم:
Class A 10.0.0.0/24 – 2 = 22
Class B 172.16.0.0/16 – 2 = 14
Class C 192.168.0.0/8 – 2 = 6
IP Address subneting
172.16.0.0 = IP address class B مثال:۱
255.255.0.0 = Default subnet mask
میخواهیم به network 100تقسیم نمایم یعنی ضرورت به 100داریم.پس 2را بتوانی باالبرده که
ازهمان عدد یعنی 100کم نشود ازآن بزرگتر باشد وزیاد نزدیک به همان عدد باشد27 – 2 = 126 .
پس به همان اندازه یا همان توان گرفته شده bitهای offرا onمیکنیم.
172.16.0.0
255.255.0.0
255.255.11111110.00000000
255.255.254.0 custom subnet mask
8
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
تعداد hostهای خود را ازاین طریق پیداکرده میتوانیم یعنی به هر تعداد که صفر است به همان تعداد
2را بتوان باال برده.
255.255.0.0
255.255.11111111.11000000
255.255.255.192 custom subnet mask
26 – 2 = 62 user
165.100.0.0 = = > network
165.100.0.1
.
Hosts
.
165.100.0.62
165.100.0.63 = = > broadcast
9
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
165.100.0.65 = = > network
165.100.0.66
.
Hosts
.
165.100.0.128
165.100.0.129 = = > broadcast
Switch configuration
Switchیکی ازوسایل میباشد که برای وصل نمودن چندین کمپیوتر استفاده میگردد switchدارای portهای مختلف
میباشد که از 96, 48, 16, 8, 4میباشد.
Switchهای ciscoیا deviceهای ciscoازیک آدرس استفاده میکند که بنام )MAC (media access control
یاد میگردد همه macآدرس های switchدر COM tableثبت وذخیره میگردد.
وقتیکه یک کس یک کمپیوتررا communicationمینماید با یک کمپیوتر دیگر در آن صورت معلومات میرود به
switchبعد میرود به COM tableوزمانیکه یک کمپیوتر communicationمیکند به کمپیوتر ضرورت به COM
tableدارد ومکمل MACآدرس ها ثبت و ذخیره میباشد در. COM table
10
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
: وپیکربندی نمودconfiguration راswitch ازطریقه های ذیل میتوانیم
Configuration of switch
راswitch تاpc بهport console توسطswitch میباشد برای وصل نمودنrollover باراول ضرورت به کیبل
. نمایمconfiguration
Interface of switch:
LAN interface
Management interface
Console interface
AXL interface
کارمیکند امکان دارد مثلlayer3 های که درswitch کارمیکندlayer3 و هم درlayer2های داریم هم درSwitch
کارمیکند و همچنان درشبکه محلیswitch استفاده میکند مثل یکlayer2 های که ازswitch کارکند وrouter یک
.کار میکند
به این معنا کهconsole. یادمیگرددAXL وconsole استفاده میگردد بنامconfiguration های که برایInterface
راswitch که میتواند از راه دور یکAXL کرد وconfiguration رامیتواند از راه نزدیکswitch
. نمایمconfiguration
. یادمیگرددnetwork layer رابنامlayer 3 یادمیکند وdata link layer را بنامLayer 2
Switch mode
User interface mode
Privileged mode
Global configuration mode
Interface mode
ها را مشاهیده مینمایم ونمیتوانیم توسطconfiguration میتوانیمmode توسط این:User interface mode
.آن تغییرات بیاوریم
. بیاوریمswitch یکconfiguration میتوانیم تغییرات درmode توسط این:Privileged mode
یکconfiguration میتوانیم تغییرات عمومی درmode توسط این:Global configuration mode
. بیاوریمswitch
login دست رسی پیدامیکنیم یاdevice هایinterface میتوانیم بهmode توسط این:Interface mode
.میشویم
11
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
: دارای یک عالمه میباشدmode هر
Mode symbol
User mode Switch>
Privileged mode Switch#
Global configuration mode Switch(config)#
Interface mode Switch(config-if)#
Mode Explanation
Switch>enable privileged رفتن به
Switch# configure terminal global رفتن به
Switch(config)# interface fast Ethernet 0/1 port تعین نمودن نمبر
Switch(config-if)#exit خارج شدن
Switch(config)#exit خارج شدن
Switch# exit خارج شدن
Security switch
. security داریم برایprocedure ما سه نوع
1. Console password
2. telnet password
3. enable password
آنراconsole را ازطریق کیبلswitch میباشدکه چطورمیتوانیم یکpassword عبارت از:Console
. ما درامن باشدswitch بدهیم تاpassword
راpassword برای وی بیگوید کهswitch اگر کسی از راه دور درشبکه بیخواهد داخل شود و:Telnets
.وارید کنید
بیرودprivileged mode بهuser mode میباشد اگر کسی بیخواهد ازpassword عبارت از:Enable
. بیخواهدpassword از آن
Console password:
Switch>enable
Switch# configure terminal
Switch (config) #line console 0
Switch (config-line) #password123
Switch (config-line) #login
Switch (config-if) #exit
Switch (config) #exit
Switch# exit
. ازصفر شروع میباشدport console بخاطری صفر نوشته کردیم که
12
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Telnets password:
Switch>enable
Switch# configure terminal
Switch (config) #line vty 0 4
. شودswitch واریدremote میتواند ازساحات4 user به این معنا که4 دراینجا
Switch (config-line) #password1234
Switch (config-line) #login
Switch (config-if) #exit
Switch (config) #exit
Switch# exit
درآن عالمه سوالیه (؟) را4 شود به جایlogin میتواندswitch اگربیخواهید که بیدانید که چند نفردراین
.شودlogin نفر میتواند15 به تعدادcisco هایswitchنوشته نماید که عموما در
Enables password:
Switch>enable
Switch# configure terminal
Switch (config) #enable password 12345
Switch (config-if) #exit
Switch (config) #exit
Switch# exit
switch# copy running-config start- داریم بنامcommand ما یکswitch یکconfiguration برای ثبت نمودن
. config
کهcommand استفاده نموده یک بارحروف اول همانswitch help را نوشته کنیم ازcommand اگربیخواهیم یک
دیگر را یاد ندارید عالمهcommand را یاد داریدcommand را فشارداده واگریکtab بیخواهیم نوشته نمود بعد
را که ضرورت دارید نوشته کرده وبعد ازآن عملیه را خودشcommand سوالیه دراخیر آن نوشته لیست میدهد همان
( میباشدwr) که عبارت ازconfiguration دیگر برای ذخیره نمودنcommand وهم میتواند ازیک.انجام میدهد
.اسفاده کرد
Switch# wr
13
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
بعد در CMDرفته نوشته میکنید برای وارید شدن به switchتوسط . telnet
Telnet 192.168.1.1
?What is VLAN
Virtual local area networkبه این معنا ومفهوم که دربین یک شبکه چندین شبکه دیگر را به وجود میاوریم.
بصورمثال اگر بیخواهیم دریک دفتر یک شبکه را به دیپارتمنت هاای دیگار تقسایم نماایم درآن صاورت از vlanاساتفاده
میکنیم ویا اگر بیخواهیم ساحه broadcastراکم بیسازیم ازاین دستور استفاده میکنیم .دریک شبکه بعضی اوقاات late
and seeزیاد به وجود میآید وقفاه هاا بسایار باه وجاود میآیاد درآ ن صاورت ضارورت باه vlanداریام .اگار vlanنباشاد
شاابکه بااا مشااکل یااا problemروبااررو میگااردد خااوبی آن درایاان میباشااد کااه آن باارای securityیااا امنیاات شاابکه مااورد
استفاده قرارمیگرد که درشبکه های internetکی بتواند دست رسی داشته باشد و کی دست رسی نداشته باشد.
Vlanهااا ن اار بااه ور ن هااای مختلااف تعااداد vlanهااا راتشااکیل میدهااد بطورمثااال switch1900میتوانااد 64 vlan
راتشکیل دهد و همچنان ور ن 2950و 2960میتواند 8000 vlanرا به وجود میآورد مکمل پورت های یک switch
مرباوط vlan1میگاردد و هماین vlan1بناام administrative vlanیاا vlanمادیریتی یاادمیگردد administrative
vlanحذف یا deleteنمیگردد changeنمیگردد وهمچنان نامش تغییر نمیکند.
VLAN characteristics:
1. switch forward frames between devices in the same VLAN
2. They cannot forward frames between different VLANs
3. Routers can be used to essentially route packets between VLANs
Benefits of VLAN:
Broadcast control
Security
Performance
Network management
Types of VLANs:
1. Static VLAN
2. Dynamic VLAN
:Static vlanعبارت از vlanمیباشد که توسط مدیران ITاین configurationمیشود توسط مدیران ITایارسازی
configurationصورت میگیرد معلومات به switchمیدهد.
:Dynamic vlanاین توسط مدیران ITصورت نمیگیرد به شکل اتومانیک configurationتوسط protocolها
صورت میگیرد.
مثال :۱میخواهم دریک دفتر یک switchرا به بخش های مختلف تقسیم نمایم.
Switch>enable
Switch# vlan database
Switch (vlan)# vlan 2 name ICT
Switch (vlan)# vlan 3 name FIN
Switch(vlan)#exit
14
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
vlan ها را معرفی میکنیم برای هرport حال
Switch# config terminal
Switch (config) #interface fast Ethernet 0/3
Switch (config-if) #switch port access vlan 2
Switch (config-if) #exit
Switch (config-if) # interface fast Ethernet 0/4
Switch (config-if) #switch port access vlan 2
Switch (config-if) # exit
Switch (config) #exit
Switch# wr
Switch# config terminal
Switch(config)# interface fastEthernet 0/2
Switch(config-if)# switchport access vlan 3
Switch(config-if)#exit
Switch(config)#exit
Switch# wr
اضافه نمایم دراین صورت آن ها با همه کمپیوترها یعنی با تمامswitchاگربیخواهیم که یک دوکمپیوتر رادر
. میگرددvlan 1 دیمارتمنت ها گفتگومیکند چرا که همه آنها مربوط
. اضافه میکنیمICT را در دیپارتمنت6 حاالمیخواهیم کمپیوتر
Switch# config terminal
Switch (config)# interface fast Ethernet 0/6
Switch (config-if)#switch port access vlan 2
Switch (config-if)# exit
Switch (config-if)# exit
Switch# wr
در همان جاکه وی میباشد مربوط دفترمالی میباشد چیswitch0 اگریک نفردریک منزل دیگرباشد بیخواهد که در
vlan2 آنرا معرفی میکنیم ومربوطport جور میکنیمvlan میرودswitch 1در.طورمیتواند این کاررا انجام دهد
باvlan 2 میدهیم که آن بدون کمپیوتر های مربوطip کمپیوتر را.میسازیم تا که همرای دفتر مربوطه گفتگوکند
یکswitch1 ها گفتگو نمیکند پس اگر بیخواهیم مربوط دفتر مالی آن را بیسازیم اول باید درvlan کمپیوتر های دیگر
. بیسازیمvlan
Switch>enable
Switch# vlan database
15
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Switch (vlan) # vlan 2 name ICT
Switch (vlan) # vlan 3 name FIN
Switch (vlan) #exit
Switch# config terminal
Switch (config) #interface fast Ethernet 0/2
Switch (config-if) #switch port access vlan 2
Switch (config –if) # exit
Switch (config) # exit
Switch# wr
راvlan رامعرفی میکنیم اگربیخواهیم یکswitch بازهم اگردریک دیپارتمنت میباشد گفتگونمیکند درآن صورت
استprocedure یکTrunk . استفاده میکنیمvlan trunking های مختلف وصل نمایم درآن صورت ازswitchدر
میزند ترافیک را مهر میزند و همچنان آن رانشانی میکند وقتیکه ازtrunk که زمینه این را مساعد میسازد ترافیک را
. انجام میدهدtrunk یک شبکه به شبکه دیگر میرود این همه امکانات را
Type of trunk:
1. Access links
2. Trunk links
single vlan یعنی توسطsingle vlan ها را توسطdevice نیمconnect توسط این میتوانیم:Access links
.ارتباطات را اجرا میکند
ها میخواهد که معلومات انتقال بدهد بین انواعswitch ها میباشد که اینswitch به این معناکه انواع:Trunk links
. میگابات دریک ثانیه باشد1000,100 ها سرعت آن میشودvlanمختلف
این همه امکانات راserver وswitch بینrouter وswitch بینswitch وصل میگردد بین دوPoint to point
. بوجود میآوردtrunk vlan
16
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Switch (config-if) #exit
Switch (config) #exit
Switch# wr
:Switch1
Switch>enable
Switch# config terminal
Switch (config) # interface fast Ethernet 0/7
Switch (config-if) # switch port mode trunk
Switch (config-if) # exit
Switch (config) # exit
Switch# wr
. میسازیمICT معرفی نمایم یعنی مربوط دیپارتمنتvlan2 را بهswitch1 مربوطpc میخواهیم
Switch>enable
Switch# config terminal
Switch (config) # interface fast Ethernet 0/1
Switch (config-if) #switch port access vlan 2
Switch (config-if) #exit
Switch (config) #exit
Switch# wr
Switch# exit
17
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
First test:
Name
F/name
Class: CCNA
Time: 5-6 PM
7. What is protocol?
18
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Configuration of two VLAN
چیگونه VLANها مختلف بین خاود communicationدر یاک switchمینمایاد درآن صاورت ماا ضارورت باه یاک
deviceداریم که مربوط به layer 3میباشد یعنی به layer 3کارمیکناد نقطاه یاا deviceمرباوط layer 3را کاه درآن
جااا نصااب میکناایم بنااام Routerمیباشااد ویااا Switchبنااام Internet exchange pointیااادمیگردد کااه نقطااه تبادلااه
معلومات میباشد پس این یک پرو ک خوب برای اداره نمودن یک شبکه میباشد.
زمانیکه یک شخص یک معلومات را روان میکند به destinationو زمانیکه به routerمیرسد routerچیگونه میداند
که این معلومات به destinationمیرود این به اساس دو پروتوکل 802.1Qو ICLصورت میگیرد.
قبل ازاینکه ما یک projectرا آغاز میکنیم باید documentationداشته باشیم بعد دیگرکارهای آن صورت گیرد.
Switch> enable
Switch# vlan database
Switch# vlan 10
Switch # vlan 30
Switch (vlan) #exit
Switch# exit
Commandذیل به ما نشان میدهد که کدام vlanها تشکیل شده است.
Switch# show vlan brief
ولی یاد باید بیگیریم که کدام portها مربوط vlanها نیست حاال همان portهای که به کمپیوترهای مربوطه وصل
است آن ها را مربوط vlanهای مربوطه آن میسازیم برای بار اول هر کمپیوتر را IPهایشان را subnetهایشان را و
همچنان getwayهریک از آن ها را تعین نمایم.
19
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Pc2:
Switch# config terminal
Switch (config) #interface fastEthernet 0/2
Switch (config) # switchport mode access
Switch (config) # switchport access vlan 10
Switch (config) # exit
Switch (config) # exit
Switch# wr
Pc3:
Switch# config terminal
Switch (config) #interface fastEthernet 0/3
Switch (config) # switchport mode access
Switch (config) # switchport access vlan 30
Switch (config) # exit
Switch (config) # exit
Switch# wr
Pc4:
Switch# config terminal
Switch (config) #interface fastEthernet 0/4
Switch (config) # switchport mode access
Switch (config) # switchport access vlan 30
Switch (config) # exit
Switch (config) # exit
Switch# wr
. ها وصل استport با کدامvlan30 وvlan10 میتوانیم بیدانیم کهcommand توسط این
Switch# show vlan brief
20
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
میگابایت دریاک ثابیاه معلوماات دهاد شابکه هاای دیگار هام122 یک شبکه به یک استندرد باشد اگر یک شبکه میخواهد
. های جداگانه داریمinterface باید همین مقدارمعلومات را انتقال دهد درغیر آنصورت ضرورت به
ایان طاور نمیباشادswitch باشاد اماا درon میباشاد بایاد آن هاا راoff هااinterface را وصال مینماایمrouter زمانیکه
.میتواند به شکل اتومات وصل گردد
Continue with configuration dialog? [Yes/no]: no
Router> enable
Router# config terminal
Router (config) # interface fastEthernet 0/0.10
. ها را تشکیل میدهیمsubinterface داخل نمیگرددinterface به این معنا که شما به کدام2/2
Router (config-subif) #encapsulation dot1q 10
Router (config-subif) # ip address 172.17.10.1 255.255.255.0
Router (config-subif) # no shutdown
Router (config-subif) # exit
Router (config) # exit
Router # wr
Router (config-subif) #encapsulation dot1q 30
Router (config-subif) # ip address 172.17.30.1 255.255.255.0
Router (config-subif) # no shutdown
Router (config-subif) # exit
Router (config) # exit
Router # wr
شااد میتاوانیم بااه آن هاااon ننمااایم زمانیکاهon شااده نمیتااوانیم کاه آن هااا راlogin هااای عماومیinterface تاا وقتاای باه
. نمودن آن ها قرار ذیل میباشذon شد وlogin
Router# config terminal
Router (config) # interface fastEthernet 0/0
Router (config-if) # no shutdown
Router (config) # exit
Router# wr
21
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
: قرار ذیل میباشدswitch درtrunk حال عمل انجام دادن
Switch# config terminal
Switch (config) # interface fastEthernet 0/3
Switch (config-if) #switchport mode trunk
Switch (config-if) # exit
Switch (config) #exit
Switch# wr
22
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Switch ports security
COM = Content Addressable Memory داریم بارای امنیات شابکهCOM table برای باراول ما ضرورت به
. وصل میباشد در آن ثبت و ذخیره میباشدSwitch آدرس ها که همرایMAC یک حافط میباشد که مکمل
Content addressable memory:
One of the three main function of a switch is to learn which devices are associated which
interface.
This information is stored in a port address, or CAM table.
Three key items are stored in the MAC table of a switch:
MAC address
Port interface
Static or Dynamic configuration
. ثبت و ذخیره میباشدSwitch آدرس دریکMAC برای فهمیدن یا دانستن اینکه چیقدر
آدرس ثباات وذخیااره میباشااد ازایاان دستوراسااتفادهMAC شااما میتوانیااد بداینااد کااه چقاادر2052 و1022 هااایswitchدر
:میگردد
Switch# show mac-address-table
:switch 1900مثال در
Switch> enable
Switch# show man-address-table
Number of permanent addresses: 1
Number of restricted static address: 0
23
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Switch 2950 this switches can hold up to 8192 entries in their CAM table.
. clear mac-address از دستور ذیل استفاده میکنیمCAM table یا پاک نمودنclear برای
Switch> enable
Switch# config terminal
Switch (config) # mac-address static 0006.3ea9.9c88 vlan 1 interface fastEthernet 0/3
Switch (config) #exit
Switch# exit
Switch# show mac-address-table
:بعد از انجام عمل باال
. تبدیل کردStatic بهDynamic آدرس های دیگر را ازMAC به همین ترتیب میتوان سه
24
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Sticky
Procedure یک کار بسیار مشکیل و خیلی مغلق میباشد پس ازPC آدرس های هزارانMAC برای معرفی نمودن
وصل شد همانport میباشد که هر کس بار اول آمد درprocess یاد میگردد که عبارت ازsticky استفاده میکنیم بنام
. وی میگردد هر کسی که باشد به اشخاص دیگر اجازه نمیدهدport
Switch> enable
Switch# config terminal
Switch (config) # interface fastEthernet 0/1
Switch (config) # switchport mode access
Switch (config) # switchport port-security
Switch (config) # switchport port-security mac-address 1111.2222.3333
by تعین گردیدهswitch استفاده نماید که درport توسط این دستورما میتوانیم تعین کنیم که چند نفر همزمان از یک
. استفاده کندport نفر میتواند از یک121 میتواندdefault
Switchport (config-if) #switchport port-security max 12
. نمایم از دستور ذیل استفاده میگرددprotect اگر بیخواهیم آنرا
Switchport (config-if) # switchport port-security violation protect
Switch
Switch> enable
Switch# config terminal
Switch (config) # sw
Switch (config) # interface fastEthernet 0/1
Switch (config-if) # sw
Switch (config-if) # switchport mode access
Switch (config-if) # switchport port-security
Switch (config-if) # switchport port-security mac-address sticky
Switch (config-if) # switchport port-security violation shutdown
Switch (config-if) # exit
Switch (config-if) # exit
Switch> enable
Switch# config terminal
Switch (config) # sw
Switch (config) # interface fastEthernet 0/2
25
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Switch (config-if) # sw
Switch (config-if) # switchport mode access
Switch (config-if) # switchport port-security
Switch (config-if) # switchport port-security mac-address sticky
Switch (config-if) # switchport port-security violation shutdown
Switch (config-if) # exit
Switch (config-if) # exit
. ها این دستوررا انجام میدهیمport به همین ترتیب در همه
Switch # show port-security
Step 3:
You can now list the contents of your flash by running
switch: dir flash:
Directory of flash: /
2 -rwx 12300 <date> config.text
4 -rwx 1906 <date> private-config.text
5 -rwx 676 <date> vlan.dat
6 -rwx 8040418 <date> c2960-lanbasek9-mz.122-50.SE3.bin
7 -rwx 2072 <date> multiple-fs
There should be a file named ‘config.text’, as you can rename this file as follows:
switch: rename flash:config.text flash: oldconfig.backup
Step 4:
To further boot the switch run the boot command as:
switch: boot
This will start the boot you are used to. When the switch is booted up, you will realize that the
configuration is gone. But you are enabled on the switch now.
Step 5:
26
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
To recover the old configuration:
Switch# rename flash: oldconfig.backup flash:config.text
And now to replace the running configuration with the backup
Switch# copy flash: config.text running-config
Destination filename [running-config]?
Press enter, and you will have your old switch configuration back and you are enabled.
Just remember to change your password now
Switch# wr
Cisco switches use the proprietary VTP to exchange VLAN configuration information
between switches.
VTP only matters when multiple switches use multiple VLANs
Example:
. تقسیم بندی گرددvlan را پیکره بندی نمایم و آنها را به پنجswitch دانه12 دراین مثال ما میخواهیم
You would have to enter the same config command on all ten switches to create VLAN 3.
Number of configurations = 10
You would create VLAN 3 on one switch, and the other nine switches would learn about
VLAN 3 dynamically.
Number of configurations = 1
With VTP:
27
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
The changes are distributed as a broadcast throughout the network every 5 minutes or
when there is a change.
Both VTP clients and servers hear the VTP messages and update their configuration
based in those messages.
Server
Client
Transparent
For VTP to exchange information, some switches act as servers, and some act as clients.
VTP Modes
VTP modes
Disabling VTP:
VTP configuration
When you create the VTP domain, you have a number of options, including:
Setting the domain name, password, operation mode, and pruning capabilities of the switch.
Use the VTP global configuration mode command to set all this information.
After you configure the VTP information, you can verify it with the show vtp command.
28
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
هاswitch بینpassword، domain داریمmode وpassword ، domain ما ضرورت بهvtp نمودنconfigure برای
: ها باید نوشتswitch درور ن های پائین. مختلط نباشد درغیر آن کارنمیکند.باید مشابه باشد
. ودیگر چیزهای آن معلومات میدهدVLAN این دستور برای مشاهده نمودن معلومات درمورد ور ن
. های خود نام داد زیرا مشابهت ها بین آنها به وجود میایدswitch برای باراول باید به
Example:
Sever
Switch> enable
A (config-if) # no shutdown
A(config-if) # exit
A (config) # exit
A # wr
A #config terminal
A (config) # exit
A # wr
Server switch:
A # vlan database
29
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
A (vlan) # vlan 2 name admin
A (vlan) # exit
A # wr
A # vlan database
A (vlan) #exit
A #config terminal
A (config) # exit
A # wr
Switch 1:
B (config-if) # no shutdown
B (config-if) # exit
B (config) # exit
B #wr
B #config terminal
B (config) # exit
B # wr
Switch 2:
30
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Switch > enable
C (config-if) # no shutdown
C (config-if) # exit
C (config) # exit
C #wr
C #config terminal
C (config) # exit
C # wr
Switch 3:
D (config-if) # no shutdown
D (config-if) # exit
D (config) # exit
D #wr
D #config terminal
D (config) # exit
D # wr
31
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Switch 4:
E (config-if) # no shutdown
E (config-if) # exit
E (config) # exit
E #wr
E #config terminal
E (config) # exit
E # wr
Switch 5:
F (config-if) # no shutdown
F (config-if) # exit
F (config) # exit
F #wr
F #config terminal
32
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
F (config) # exit
F # wr
A # config terminal
A (config-if) # exit
A (config) # exit
A # wr
A # config terminal
A (config-if) # exit
A (config) # exit
A # wr
A # config terminal
A (config-if) # exit
A (config) # exit
A # wr
A # config terminal
A (config-if) # exit
A (config) # exit
A # wr
A # config terminal
A (config-if) # exit
33
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
A (config) # exit
A # wr
Switch 1:
B # config terminal
B (config-if) # exit
B (config) # exit
B # wr
Switch 2:
C # config terminal
C (config-if) # exit
C (config) # exit
C # wr
Switch 3:
D # config terminal
D (config-if) # exit
D (config) # exit
D # wr
Switch 4:
E # config terminal
E (config-if) # exit
E (config) # exit
E # wr
34
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Switch 5:
F # config terminal
F (config-if) # exit
F (config) # exit
F # wr
دستورهای کهshow running-config وتوسط دستور. این دستور را انجام دادهclient هاswitch به همین ترتیب در همه
. گردیده است نشان میدهدconfiguration استفاده یاswitch در
نمائیمconfigure راSwitch و چیگونه میتوانیم ازاین طریق یکprotocol HTTP ازطریقswitch فعال نمودن یک
یاcentral point داشته باشیم و میخواهیم آنها را دریکswitch خوبی آن دراین میباشد اگر ما دریک دفتر یا اداره چندین
دیگر خوبی آن. میتوانیم این کار را انجام دادProtocol HTTP نمائیم ازطریقconfiguration یک نقطه مرکزی آن ها را
صورتGraphical User Interface یا به اساسGUI از طریقswitch یکConfiguration دراین میباشد که مکمل
.میگیرد
ها آنها چی میباشد درکجا میباشد درموردIP address داشته باشیم کهswitch از همهdocumentation پس ما باید یک
. ها وبه همین ترتیب درمورد آن معلومات کامل داشته باشیمport
Switch> enable
35
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Switch (config) # enable password 1234
Switch # wr
access را که میخواهیم کهswitch همانinternet explorer بعد از مراحل باال درswitch نمودن یکaccess برای
داخل میشویمswitch آنرا وارید نمودن بعد ما درpassword وusername نمودنaccess آنرا مینوسیم بعد ازIP نمایم
. ها را انجام میدهیمconfiguration
Cisco های کمپنیRouter. میباشد که برای وصل نمودن شبکه های انترنیتی مورد استفاده قرار میگیردDeviceعبارت از
. میباشدlayer عموما به سه بخش یا
ها خورد مورد استفاده قرارorganization های میباشد که برای کمپنی ها یاrouter عبارت ار:Access layer Router
: های ذیلseries میگیرد مانند
ISP layer ها استفاده میکند که گاهی بنامISP های میباشد که ازآن هاrouter عبارت از:Distribution layer Router
: های ذیلseries یاد میگردد مانندrouter
مورد استفاده قرارGlobal ISPs های جهانی یعنیISP های میباشد که توسطRouter عبارت از:Core layer Router
: های ذیلseries میگیرد مانند
Cisco series: 6400, 7200, 7300, 7400, 7500, 7600, 10000, 12000
. میباشدBuses, NVRAM, Flash, RAM, CPU، Interface, ROM, دارایcomputer نیز مانند یکRouter
LAN interface
WAM interface
Management interface
. را با شبکه های داخلی وصل میکندrouter های میباشد کهinterface عبارت از:LAN interface
. وصل میکندWAM را با شبکه هایrouter های میباشد کهinterface عبارت از:WAN interface
. ها استفاده میکنیمinterface را کنترول کنیم مدیریت کنیم ازاینrouter اگر بیخواهیم:Management interface
36
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
. ها به دو بخش تقسیم گردیده استManagement interface
نمایم درآنconfigure را از فاصله های نزدیکrouter های میباشد که بیخواهیم کهinterface عبارت از:Console
. ها استفاده میکنیمport صورت ازاین
router درswitch و همچنان مانند. استفاده مینمایمDB9 Converter نباشد یعنی نداشته باشد ازserial اگردرکمپیوتر پورت
. های نیزمیباشدmode هم
Mode Symbol
User mode Router>
Privileged mode Router #
Global configuration mode Router (config)#
Interface mode Router (config-if)#
. مشاهده نمایم ازدستور ذیل استفاده میکنیمrouter های قبلی را درconfiguration اگربیخواهیم
. های قبلی را کاپی نمایم از دستورذیل استفاده مینمایمconfiguration اگربیخواهیم دستورها یا
Console password:
router>enable
Router# configure terminal
router (config) #line console 0
router (config-line) #password123
router (config-line) #login
router (config-if) #exit
router (config) #exit
router# exit
. ازصفر شروع میباشدport console بخاطری صفر نوشته کردیم که
Telnets password:
router>enable
router# configure terminal
37
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
router (config) #line vty 0 4
. شودrouter واریدremote میتواند ازساحات4 user به این معنا که4 دراینجا
router (config-line) #password1234
router (config-line) #login
router (config-if) #exit
router (config) #exit
router# exit
درآن عالمه سوالیه (؟) را4 شود به جایlogin میتواندrouter اگربیخواهید که بیدانید که چند نفردراین
.شودlogin نفر میتواند15 به تعدادcisco هایrouterنوشته نماید که عموما در
Enables password:
router>enable
router# configure terminal
router (config) #enable password 12345
router (config-if) #exit
router (config) #exit
router# exit
میباشد که نشان میدهد که یک معلومات را ازیک شبکه به شبکه دیگرچگونهprocess عبارت از یکRouting
ثبت وذخیرهdatabase معلومات آن در یکrouting یاد میگردد کهrouting هدایت داده میشود این پروسه بنام
router زمانیکه یک. یاد میگرددrouting table جابجا میباشد که بنامtable در یکdatabase میگردد که این
. میکند ازدوطریق صورت میگیردcommunication دیگرrouter همرای یک
Two way to know router WAN network:
Static routing: by IT manager and used for small network.
38
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Dynamic routing: automatically for router and used for large network.
کار میکندnetwork layer عبارت از پروتوکل میباشد در:Routed protocol
Routed protocol: IP, IPX it is works on network layers.
استفاده میگردد برای پیداکردن را ها که چیگونه معلومات ازکدام راهاWAN درشبکه های:Routing protocol
.روان ودریافت میگردد
AS(autonomous system)
یاد میگردد که ازیک نمبر خاص استفاده میکند کهAS تحت یک مدیریت واحد قرار گیرد بنامrouter زمانیکه چندین
ها داده میشود که این توسطISP یک نمبر مشخص میباشد که ازطریق دولت بهAS میباشد655.5 شروع الی2از
. درجهان کنترول میگرددIANN یک اداره بنام
کارمیکند که اگر بیخواهم درداخل کشور چندین شبکه راAS این تحت اداره: interior getway protocols :IGPs
. استفاده مینمایمIGPsوصل نمایم درآنصورت از
E.g: RIP, GRP, EIGRP, OSPF
افغانستان با هم وصل نمایم در آنAS ایران را باAS های مختلف را باهم وصل نمایم بطورمثالAS اگر بیخواهیم
. یاد میگرددexterior getway protocol استفاده نموده که بنامProtocol صورت از این
E.g: BGP
BGPs های مختلف باشد و بیخواهیم یک نفطه مرکزی برای تبادله معلومات بوجود بیاوریم در آن صورت ازASاگر
.استفاده میکنیم
Router1:Bakhtar
Router> enable
Router#config terminal
Router(config)#interface fastEthernet 0/0
Router(config-if)# ip address 192.168.1.1 255.255.255.0
Router(config-if)# no shutdown
Router(config-if)# exit
Router(config) exit
Router> enable
Router#config terminal
Router(config)#interface fastEthernet 0/1
Router(config-if)# ip address 172.16.16.1 255.255.255.0
Router(config-if)# no shutdown
39
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Router(config-if)# exit
Router(config) exit
Rip
Router# config terminal
Router(config)#router rip
Router(config-router)#network 192.168.1.0
Router(config-router)#network 172.16.16.0
Router(config-router)#exit
Router(config)#exit
rip
Router# config terminal
Router(config)#router rip
Router(config-router)#network 172.16.16.0
Router(config-router)#network 10.0.0.0
Router(config-router)#exit
40
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Router(config)exit
Router3: sunshine
Router> enable
Router#config terminal
Router(config)#interface fastEthernet 0/0
41
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
rip
Router# config terminal
Router(config)#router rip
Router(config-router)#network 10.0.0.0
Router(config-router)#network 20.0.0.0
Router(config-router)#exit
Router(config)#exit
42
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Router (2) ISP (Afghan Telecom): In Afghanistan
Router> enable
Router # config terminal
Router(config) # interface fastEthernet 0/0
Router (config-if)# ip address 20.0.0.2 255.0.0.0
Router(config-if)# no shutdown
Router(config-if)# exit
Router (config)# exit
Router # config terminal
Router(config) # interface serial 0/0/0
Router (config-if)# ip address 50.0.0.1 255.0.0.0
Router(config-if)# no shutdown
Router(config-if)# exit
Router(config)# exit
Router# wr
43
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Router (4) customer (bakhtar): get service from Etisalat
Router> enable
Router # config terminal
Router(config) # interface fastEthernet 0/0
Router (config-if)# ip address 192.168.0.1 255.255.255.0
Router(config-if)# no shutdown
Router(config-if)# exit
Router (config)# exit
Router # config terminal
Router(config) # interface fastEthernet 0/1
Router (config-if)# ip address 40.0.0.1 255.0.0.0
Router(config-if)# no shutdown
Router(config-if)# exit
Router(config)# exit
Router# wr
. را معرفی کنیمNetwork را انجام دهیم تاRIP شده میخواهیمconfigure ها در همه از آن هاIP حاال
44
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Router(config)# exit
Router# wr
آدرس را بهIP میباشد بایدGateway کهCLASS آدرس ها را معرفی میکنیم از هرIP دراخیر به کمپیوتر ها
. باشدClass کمپیوتر ها از همان
45
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Sunshine: Afghanistan
PC1:
Ip address: 172.16.16.2
Subnet mask: 255.255.255.0
Default gateway: 172.16.16.1
Bakhtar: Pakistan
PC1:
Ip address: 192.168.0.2
Subnet mask: 255.255.255.0
Default gateway: 192.168.0.1
46
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
DHCP Server configuration In Router
……………………………:DHCP
DHCP Discover: clients broadcast this address to DHCP 255.255.255.225 and this IP
0.0.0.0
DHCP Offer: DHCP providing this IP forward for client.
Source IP: IP of DHCP
Destination MAC address: client destination IP 255.255.255.0 from the range
if IP.
DHCP request: the DHCP offer IP is broadcasting from client’s side to all network.
DHCP ack, DHCP nack: if IP is not blocked by admin from DHCP range DHCP is
sending nack massage for clients.
گردد وset بایدmanually میباشد به بشکلserver های که مربوط همهIP به وجود نیاید بایدduplicate برای اینکه
دقیقه را دربر میگیرد تا به5 حدوداDHCP به شکلIP و عمل تعین نمودن. را تعین نمایمend IP ، start IP همچنان
داریم بنامcommand ماDHCP server یکConfiguration برای. را توزیع نمایدIP هاClient
Router(config)# ip dhcp excluded-address 192.168.1.1
Router(config)# ip dhcp pool internal sunshine
:Ipconfig/release
:Ipconfig/ renew
یاswitch داریم چقدرserver داشته باشیم که چقدرplanning نما یم باید یکconfiguration قبل از آن که ما
ها را که نمیخواهیم توزیع نمایم باید آنIP داریم و ما باید یک لست از آن همه وسایل داشته باشیم و همانdeviceچقدر
ها وserver توزیع گردد به همهmanually باید آورد همه آن آدرس ها باید قید نمایم یعنیExcluded list ها را به
. های که در شبکه میباشدdevice
هم به حیثrouter میباشد یعنی اینrouter با هم مشابه میباشد چرا که در یکdhcp وgateway در این مثال:مثال
. کار میکندgateway و هم به حیثdhcp server
Router customer:
Router> enable
Router# config terminal
Router (config)# interface fastEthernet 0/0
Router (config-if)# ip address 192.168.1.1 255.255.255.0
Router(config-if)# no shutdown
Router(config-if)# exit
Router(config)# exit
. میکنیم تعین گرددExcluded را معرفی مینمایم یعنی آدرس های را کهDHCP حال
Router#config terminal
Router(config)# ip dhcp excluded-address 192.168.1.1 192.168.1.10
47
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
Router(config)#exit
. یاد میگرددscope pool های را که برای توزیع نمودن میباشد بنامip مراحل توزیع یا تعین نمودن تعداد
Router(config)# ip dhcp pool sunshine
Router(config-config)# network 192.168.1.0
Router(config-config)# network 192.168.1.0 255.255.255.0
وDNS بیگیرد یا داشته باشد دوچیز خیلی مهم و ضروری میباشد که عبارت ازInternet هاclient برای اینکه
. نمیگرددaccess در آن هاinternet میباشد درغیر آنGateway
Router(dhcp-config)# default-router 192.168.1.1
Router(dhcp-config)# dns-server 192.168.1.2
Router(dhcp-config)# exit
Router(config)# exit
Router# wr
. میدهیمip وصل میباشدclient کهswitch حال به
Switch>enable
Switch# config terminal
Switch(config)# interface vlan 1
Switch(config-if)# ip address 192.168.1.5 255.255.255.0
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)#exit
Switch# wr
Router ISP:
Router>enable
Router#config terminal
Router(config)# interface fastEthernet 0/0
Router(config-if)# ip address 10.0.0.10 255.0.0.0
Router(config-if)# no shutdown
Router(config-if)#exit
Router(config)#exit
Router# wr
48
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department
49
Prepared by: Ahmad Farzad Mawlayee
Ghazni University Computer Science Department