یک پروژه آماده راه اندازی شبکه

پروژه آماده راه اندازی شبکه برای طرح های درسی و شغلی.

با سپاس از استاد ارجمند آقای مهرپویا موفق به راه اندازی یک شبکه داخلی محدود اما جامع! شدم و تصمیم گرفتم به اشتراک بگذارم که اگه مورد نیاز کسی بود بتونه ازش استفاده کنه. من در ابتدا کد ها و شرح پروژه رو قرار میدم و در آخر صفحه فایل پی دی اف pdf و pkt یا همون Cisco Packet tracer قرار میدم که بتونید دانلود کنید. اگه سوال یا نظری داشتید حتماً ازم بپرسید.

شرح پروژه:

شبکه ای داریم متشکل از 5 کاربر در دو گروه 10 (مالی) و 20 (اداری) و یک کاربر که عضو این دو گروه نیست؛ یک سرور که جهت بک آپ اطلاعات ایجاد شده است و یک کاربر خارج از محدوده داخلی شبکه که به طور مثال در یک شهر دیگر یا یک محدوده شبکه ای دیگر قرار دارد.

⚠️ کاربران هر گروه تنها مجاز به تبادل اطلاعات صرفاً در محدوده گروه خود هستند.

⚠️کاربران گروه اداری مجاز به ارتباط با سرور و اینترنت نیستند.

⚠️کاربران گروه مالی باید بتوانند با پروتکلssh  به روتر ها دسترسی داشته باشند.

⚠️کاربرانی که عضو گروه های 10 و 20 هستند باید آی پی سیستم را از طریق پروتکلDHCP  دریافت کنند اما دو کاربر دیگر و سرور باید آی پی اختصاصی داشته باشند.

⚠️ آی پی ISP  به طور مثال 85.85.85.1 تا 8 در نظر گرفته شده است که کاربران مجاز باید با استفاده از آن آی پی ها به اینترنت دسترسی داشته باشند.

⚠️ کاربر خارج از شبکه باید روی پورت 8080 به وب سرور داخلی دسترسی داشته باشد.

⚠️ روترها باید از طریق پروتکل RIP version 2 با همدیگر ارتباط داشته باشند.

⚠️ یکی از سوئیچ ها باید نقش SERVER  داشته و دو سوئیچ دیگر در نقش CLIENT قرار بگیرند و صرفاً اطلاعات گروه ها را از آن سوئیچ کپی کنند.

سخت افزارهای مورد نیاز به همراه آی پی ها:

  1. روتر داخلی که DHCP روی آن فعال می شود: مدل 2811 با دو پورت فیزیکی و سه پورت مجازی با آی پی های: 192.168.12.1 و 192.168.10.1 و 192.168.20.1
  2. روتر لبه شبکه که نقش اتصال به اینترنت را دارد: مدل 2811 با سه پورت فیزیکی با آی پی های: 192.168.12.2 و 192.168.30.1 و 85.85.85.1
  3. روتر ISP (مشخص است که واقعا به این روتر احتیاجی نداریم و صرفاً جهت شبیه سازی مدل از آن استفاده می کنیم): مدل 2811 با دو پورت فیزیکی با آی پی های: 192.168.40.1 و 85.85.85.2
  4. 5 عدد سوئیچ مدل 2811 که یکی از آنها نقش server دارد، دو تا از آنها نقش client  دارد و دو تای دیگر عضو vlan  نیستند و تنها به دلیل ایجاد شبکه ای بزرگتر استفاده می شوند.
  5. 5 دستگاه کامپیوتر که 4 دستگاه از آنها عضو گروه های 10 و 20 هستند با آی پی های DHCP و دو تای دیگر با آی پی STATIC
  6. یک دستگاه وب سرور داخلی جهت ذخیره بک آپ

پروتکل های مورد نیاز:

RIP – DHCP – SUBINTERFACE – VTP – SSH - NAT & PAT – ACCESS-LIST – DOT1Q

نمای کلی پروژه:

کد های راه اندازی پروژه CCNA

R1  روتر داخلی

Would you like to enter the initial configuration dialog? [yes/no]: noPress RETURN to get started!

Router<ena

Router#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#host

Router(config)#hostname R1

R1(config)#int fa 0/1

R1(config-if)#ip add 192.168.12.1 255.255.255.0

R1(config-if)#no shut

R1(config-if)#

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

R1(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

R1(config-if)#do wr

Building configuration...

[OK]

R1(config-if)#

R1>ena

R1#

R1#

R1#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R1(config)#int fa 0/0.10

R1(config-subif)#

%LINK-5-CHANGED: Interface FastEthernet0/0.10, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.10, changed state to up

R1(config-subif)#enca

R1(config-subif)#encapsulation dot

R1(config-subif)#encapsulation dot1Q 10

R1(config-subif)#ip add 192.168.10.1 255.255.255.0

R1(config-subif)#exit

R1(config)#int fa 0/0.20

R1(config-subif)#

%LINK-5-CHANGED: Interface FastEthernet0/0.20, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.20, changed state to up

R1(config-subif)#enc

R1(config-subif)#encapsulation dot

R1(config-subif)#encapsulation dot1Q 20

R1(config-subif)#ip add 192.168.20.1 255.255.255.0

R1(config-subif)#exit

R1(config)#ip dhcp pool VLAN10

R1(dhcp-config)#net

R1(dhcp-config)#network 192.168.10.0 255.255.255.0

R1(dhcp-config)#def

R1(dhcp-config)#default-router 192.168.10.1

R1(dhcp-config)#exit

R1(config)#ip dhcp exc

R1(config)#ip dhcp excluded-address 192.168.10.1 192.168.10.10

R1(config)#ip dhcp pool VLAN20

R1(dhcp-config)#net

R1(dhcp-config)#network 192.168.20.0 255.255.255.0

R1(dhcp-config)#def

R1(dhcp-config)#default-router 192.168.20.1

R1(dhcp-config)#exit

R1(config)#ip dhcp exc

R1(config)#ip dhcp excluded-address 192.168.20.1 192.168.20.10

R1(config)#exit

R1#

%SYS-5-CONFIG_I: Configured from console by console

R1#

R1#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R1(config)#router rip

R1(config-router)#net

R1(config-router)#ver 2

R1(config-router)#net

R1(config-router)#network 192.168.10.0

R1(config-router)#network 192.168.20.0

R1(config-router)#network 192.168.12.0

R1(config-router)#exit

R1(config)#

R1>ena

R1#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.2

R1(config)#

R1(config)#

R1(config)#

R1(config)#

R1(config)#ip dom

R1(config)#ip doman-

R1(config)#ip doman-na

R1(config)#ip domain-

R1(config)#ip domain-na

R1(config)#ip domain-name SAEIDJOZI.IR

R1(config)#cryp

R1(config)#crypto key ge

R1(config)#crypto key generate rsa

The name for the keys will be: R1.SAEIDJOZI.IR

Choose the size of the key modulus in the range of 360 to 2048 for your

General Purpose Keys. Choosing a key modulus greater than 512 may take

a few minutes.

How many bits in the modulus [512]: 1024

% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]

R1(config)#ip ssh ver 2

*Mar 1 2:31:43.742: %SSH-5-ENABLED: SSH 1.99 has been enabled

R1(config)#user

R1(config)#username jozi priv

R1(config)#username jozi privilege 15 sec

R1(config)#username jozi privilege 15 secret 1234

R1(config)#line vty 0 4

R1(config-line)#trans

R1(config-line)#transport in

R1(config-line)#transport input ssh

R1(config-line)#log

R1(config-line)#login loc

R1(config-line)#login local

R1(config-line)#exit

R1(config)#

R1(config)#

R1(config)#acc

R1(config)#acc

R1(config)#access-list 100 deny icmp 192.168.20.0 0.0.0.255 host 192.168.30.30 echo

R1(config)#acc

R1(config)#access-list 100 per

R1(config)#access-list 100 permit ip any any

R1(config)#exit

R1#

%SYS-5-CONFIG_I: Configured from console by console

R1#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R1(config)#int fa 0/1

R1(config-if)#ip acc

R1(config-if)#ip access-group 100 out

R1(config-if)#exit

R1(config)#

R2  روتر لبه شبکه

Would you like to enter the initial configuration dialog? [yes/no]: no

Press RETURN to get started!

Router>ena

Router#host

Router#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#host

Router(config)#hostname R2

R2(config)#int fa 0/1

R2(config-if)#ip add 192.168.12.2 255.255.255.0

R2(config-if)#no shut

R2(config-if)#

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

R2(config-if)#int fa 0/0

R2(config-if)#ip add 192.168.30.1 255.255.255.0

R2(config-if)#no shut

R2(config-if)#

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

R2(config-if)#

R2(config-if)#int fa 1/0

R2(config-if)#ip add 85.85.85.1 255.255.255.0

R2(config-if)#no shut

R2(config-if)#

%LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up

R2(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up

R2(config-if)#do wr

Building configuration...

[OK]

R2(config-if)#

R2>ena

R2#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R2(config)#rou

R2(config)#router rip

R2(config-router)#ver 2

R2(config-router)#net

R2(config-router)#network 192.168.12.0

R2(config-router)#network 192.168.30.0

R2(config-router)#exit

R2(config)#ip rou

R2(config)#ip route 0.0.0.0 0.0.0.0 85.85.85.2

R2(config)#

R2>ena

R2#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R2(config)#acc

R2(config)#access-list 10 permi

R2(config)#access-list 10 permit 192.168.10.0 0.0.0.255

R2(config)#access-list 10 permit 192.168.30.0 0.0.0.255

R2(config)#int fa 0/0

R2(config-if)#ip nat ins

R2(config-if)#ip nat inside

R2(config-if)#exit

R2(config)#int fa 1/0

R2(config-if)#ip nat outside

R2(config-if)#exit

R2(config)#int fa 0/1

R2(config-if)#ip nat inside

R2(config-if)#exit

R2(config)#ip nat inside sou

R2(config)#ip nat inside source list 10 int fa 1/0 overload

R2(config)#

R2(config)#ip nat in

R2(config)#ip nat inside sou

R2(config)#ip nat inside source st

R2(config)#ip nat inside source static tcp 192.168.30.30 80 85.85.85.1 8080

R2(config)#

R2(config)#

R2(config)#ip domain-n

R2(config)#ip domain-name jozi

R2(config)#cry

R2(config)#crypto key gen

R2(config)#crypto key generate rsa

The name for the keys will be: R2.jozi

Choose the size of the key modulus in the range of 360 to 2048 for your

General Purpose Keys. Choosing a key modulus greater than 512 may take

a few minutes.

How many bits in the modulus [512]: 1024

% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]

R2(config)#ip ssh version 2

*Mar 1 2:29:36.699: %SSH-5-ENABLED: SSH 1.99 has been enabled

R2(config)#user

R2(config)#username jozi pri

R2(config)#username jozi privilege 15 sec

R2(config)#username jozi privilege 15 secret 1234

R2(config)#line vty 0 4

R2(config-line)#tra

R2(config-line)#transport inp

R2(config-line)#transport input ssh

R2(config-line)#log

R2(config-line)#login loc

R2(config-line)#login local

R2(config-line)#exit

R2(config)#

روتر ISP

Would you like to enter the initial configuration dialog? [yes/no]: no

Press RETURN to get started!

Router>ena

Router#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#host

Router(config)#hostname ISP

ISP(config)#int fa 0/1

ISP(config-if)#ip add 85.85.85.2 255.255.255.0

ISP(config-if)#no shut

ISP(config-if)#

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

ISP(config-if)#do wr

Building configuration...

[OK]

ISP(config-if)#int fa 0/0

ISP(config-if)#ip add 192.168.40.1 255.255.255.0

ISP(config-if)#no shut

ISP(config-if)#

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

ISP(config-if)#

ISP>ena

ISP#conf t

Enter configuration commands, one per line. End with CNTL/Z.

ISP(config)#ip route 85.85.85.0 255.255.255.0 85.85.85.85.1

^

% Invalid input detected at '^' marker.

ISP(config)#

ISP>ena

ISP#conf t

Enter configuration commands, one per line. End with CNTL/Z.

ISP(config)#ip route 85.85.85.0 255.255.255.0 85.85.85.1

ISP(config)#

سوئیچ VTP

Switch>ena

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#hostname S1

S1(config)#int range fa 0/1-2

S1(config-if-range)#sw mo tr

S1(config-if-range)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up

S1(config-if-range)#exit

S1(config)#int fa 0/24

S1(config-if)#sw mo tr

S1(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to up

S1(config-if)#exit

S1(config)#vtp mode server

Device mode already VTP SERVER.

S1(config)#vtp ver 2

S1(config)#vtp domain SAEIDJOZI.IR

S1>ena

S1#conf t

Enter configuration commands, one per line. End with CNTL/Z.

S1(config)#vtp pass

S1(config)#vtp password 1234

%The VTP password cannot be set for NULL domain

S1(config)#vtp mode server

Device mode already VTP SERVER.

S1(config)#vtp ver 2

VTP mode already in V2.

S1(config)#vtp doma

S1(config)#vtp domain SAEIDJOZI.IR

Changing VTP domain name from NULL to SAEIDJOZI.IR

S1(config)#vtp pass

S1(config)#vtp password 1234

Setting device VLAN database password to 1234

S1(config)#vlan 10

S1(config-vlan)#exit

S1(config)#vlan 20

S1(config-vlan)#exit

S1(config)#do wr

Building configuration...

[OK]

S1(config)#

سوئیچ client1

Switch>ena

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#vtp mode client

Setting device to VTP CLIENT mode.

Switch(config)#vtp ver 2

Cannot modify version in VTP client mode

Switch(config)#vtp domain SAEIDJOZI.IR

Domain name already set to SAEIDJOZI.IR.

Switch(config)#vtp password 1234

Setting device VLAN database password to 1234

Switch(config)#int fa 0/2

Switch(config-if)#sw mo ac

Switch(config-if)#sw ac vlan 10

Switch(config-if)#exit

Switch(config)#int fa 0/3

Switch(config-if)#sw mo ac

Switch(config-if)#sw ac vlan 20

Switch(config-if)#exit

Switch(config)#sh vlan brief

^

% Invalid input detected at '^' marker.

Switch(config)#exit

Switch#

%SYS-5-CONFIG_I: Configured from console by console

Switch#sh vlan bri

VLAN Name Status Ports

---- -------------------------------- --------- -------------------------------

1 default active Fa0/4, Fa0/5, Fa0/6, Fa0/7

Fa0/8, Fa0/9, Fa0/10, Fa0/11

Fa0/12, Fa0/13, Fa0/14, Fa0/15

Fa0/16, Fa0/17, Fa0/18, Fa0/19

Fa0/20, Fa0/21, Fa0/22, Fa0/23

Fa0/24, Gig0/1, Gig0/2

10 VLAN0010 active Fa0/2

20 VLAN0020 active Fa0/3

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

Switch#

Switch#do wr

^

% Invalid input detected at '^' marker.

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#do wr

Building configuration...

[OK]

Switch(config)#

سوئیچ client2

Switch>

Switch>ena

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#vtp mode client

Setting device to VTP CLIENT mode.

Switch(config)#vtp ver 2

Cannot modify version in VTP client mode

Switch(config)#vtp domain SAEIDJOZI.IR

Domain name already set to SAEIDJOZI.IR.

Switch(config)#vtp pass

Switch(config)#vtp password 1234

Setting device VLAN database password to 1234

Switch(config)#

Switch(config)#

Switch(config)#int fa 0/1

Switch(config-if)#sw mo ac

Switch(config-if)#sw ac vlan 10

Switch(config-if)#exit

Switch(config)#int fa 0/3

Switch(config-if)#sw mo ac

Switch(config-if)#sw ac vlan 20

Switch(config-if)#exit

Switch(config)#do wr

Building configuration...

[OK]

Switch(config)#sh vlan bri

^

% Invalid input detected at '^' marker.

Switch(config)#exit

Switch#

%SYS-5-CONFIG_I: Configured from console by console

Switch#sh vlan bri

VLAN Name Status Ports

---- -------------------------------- --------- -------------------------------

1 default active Fa0/4, Fa0/5, Fa0/6, Fa0/7

Fa0/8, Fa0/9, Fa0/10, Fa0/11

Fa0/12, Fa0/13, Fa0/14, Fa0/15

Fa0/16, Fa0/17, Fa0/18, Fa0/19

Fa0/20, Fa0/21, Fa0/22, Fa0/23

Fa0/24, Gig0/1, Gig0/2

10 VLAN0010 active Fa0/1

20 VLAN0020 active Fa0/3

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

Switch#