Objective:
Share with me today a Cisco integrated small experiment, difficulty CCNA level. It mainly involves the following knowledge points: VLAN, DHCP, STP (spanning-tree) +HRSP (standby), OSPF, NAT, ACL. The GNS3 simulator is used in the experiment. The experiment is as follows:
Experimental Purpose:
The ultimate experiment was designed to allow the PC to access the R2 loopback interface (the Internet is being emulated here). Specific implementation details, according to the configuration to determine their own. In doubt, please leave a comment below, and welcome to discuss together.
Experimental topology diagram:
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/99/74/wKiom1lImlGQ9HYnAAB4Iit-y_o919.jpg "title=" Qq20170620114349.jpg "alt=" Wkiom1limlgq9hynaab4iit-y_o919.jpg "/>
Specific configuration:
PC1
pc1#conf terminalPC1 (config) #no ip domain-lookuppc1 (config) #line console 0pc1 (config-line) #no exec-timeout PC1 (config ) #interface fastethernet 0pc1 (config-if) #ip add dhcpPC1 (config-if) #no shutdown
PC2 PC3 PC4 Ibid.
SW3
SW3-SW#CONF TERSW3-SW (config) #no ip routingsw3-sw (config) #no  IP DOMAIN-LOOKUPSW3-SW ( Config) #line console 0sw3-sw (config-line) #no exec-timeoutsw3-sw (config) #vlan  10SW3-SW ( Config-vlan) #vlan  20SW3-SW (Config-vlan) #vlan 255sw3-sw (config) #interface fastethernet 1/ 15SW3-SW (config-if) #switchport access vlan 10sw3-sw (config) #interface fastethernet 1/ 14SW3-SW (config-if) #switchport access vlan 20sw3-sw (config) #interface  VLAN 255SW3-SW ( CONFIG-IF) #ip  ADD 192.168.255.3 255.255.255.0SW3-SW (config-if) #no shusw3-sw (config) # INTERFACE FASTETHERNET 1/0SW3-SW (config-if) #switchport  MODE TRUNKSW3-SW (config-if) # SWITCHPORT TRUNK ENCAPSULATION DOT1QSW3-SW (config) #interface  FASTETHERNET 1/4SW3-SW ( CONFIG-IF) #switchport  MODE TRUNKSW3-SW (config-if) #switchport trunk encapsulation DOT1QSW3-SW (config) #spanning-tree&nBSP;VLAN 10SW3-SW (config) #spanning-tree vlan 20
SW4
SW4-SW (config) #no ip routingsw4-sw (config) #no ip domain-lookupsw4-sw (config) #line CONSOLE 0SW4-SW (config-line) #no exec-timeoutsw4-sw (config) #vlan 10sw4-sw (Config-vlan) #vlan  20SW4-SW (Config-vlan) #vlan 255sw4-sw (config) #interface fastethernet 1/15sw4-sw (config-if) #switchportSW4-SW (config-if) #switchport access vlan 10sw4-sw (config-if) #no  SHUSW4-SW ( Config) #interface fastethernet 1/14sw4-sw (config-if) #switchport  ACCESS VLAN 20SW4-SW ( CONFIG-IF) #no shusw4-sw (config) #interface fastethernet 1/0sw4-sw (config-if) #switchportSW4-SW ( CONFIG-IF) #switchport  MODE TRUNKSW4-SW (config-if) #switchport trunk encapsulation DOT1QSW4-SW (config) #interface fastethernet 1/3sw4-sw (config-if) #switchportSW4-SW (config-if) # SWITCHPORT MODE TRUNKSW4-SW (config-if) #switchport  TRUNK ENCAPSULATION DOT1QSW4-SW ( Config) #interface vlan 255&nbsP;    SW4-SW (config-if) #ip  ADD 192.168.255.4 255.255.255.0SW4-SW (config-if) #no shutdownsw4-sw#show vlan-switchsw4-sw (config) #spanning-tree vlan 10sw4-sw (config) # Spanning-tree vlan 20sw4-sw#write
SW2
SW2-SW (config) #no ip routingsw2-sw (config) #no ip domain-lookupsw2-sw (config) #line CONSOLE 0SW2-SW (config-line) #no exec-timeout sw2-sw (config) #vlan 10 SW2-SW (Config-vlan) #vlan 20sw2-sw (Config-vlan) #vlan 255sw2-sw (config) #interface vlan 255SW2-SW (config-if) #ip add 192.168.255.2 255.255.255.0sw2-sw (config-if) #no  SHUSW2-SW ( Config) #interface fastethernet 1/0sw2-sw (config-if) #switchportSW2-sw (config-if) #switchport mode  TRUNKSW2-SW (config-if) #switchport trunk encapsulation dot1q sw2-sw (config-if) #no  SHUTDOWNSW2-SW (config) #interface fastethernet 1/1sw2-sw (config-if) #switchportSW2-SW (config-if) #switchport  MODE TRUNKSW2-SW (config-if) #switchport trunk encapsulation dot1q SW2-SW (config-if) #no shutdownsw2-sw (config) #interface fastethernet 1/2sw2-sw (config-if) # SWITCHPORTSW2-SW (config-if) #switchport  MODE TRUNKSW2-SW (config-if) #switchport  TRUNK ENCAPSULATION DOT1Q SW2-SW (config-if) #no shutdownsw2-sw (config) #interface  RANGE FASTETHERNET 1/1 - 2SW2-SW ( Config-if-range) #channel-group 1 mode onsw2-sw (config) #spanning-tree vlan 10 PRIORITY 8192SW2-SW (config) #spanning-tree vlan 20 priority 4096sw2-sw (config) # INTERFACE VLAN 10SW2-SW (config-if) #stanSW2-sw (config-if) #standby 1 ip 192.168.10.1SW2-SW (config-if) #exitSW2-sw (config) #interface vlan 20sw2-sw (config-if) #standby 2  IP 192.168.20.1SW2-SW (config-if) #standby 2 priority 255sw2-sw (config-if) #standby  2 PREEMPTSW2-SW#SHOW STANDBY BRIEFSW2-SW (config) #ip route 192.168.100.0 255.255.255.0  192.168.255.1SW2-SW (config) #interface fastethernet 1/5sw2-sw (config-if) #ip  ADD 172.16.1.1 255.255.255.0SW2-SW (ConFIG) #router  OSPF 1SW2-SW (config-router) #network 172.16.1.0 0.0.0.255 area 0SW2-SW (Config-router) #network 192.168.10.0 0.0.0.255 area 1sw2-sw (config-router) #network 192.168.20.0 0.0.0.255 area 1
SW1
SW1-SW (config) #ip routing sw1-sw (config) #no ip domain-lookupsw1-sw (config) #line CONSOLE 0SW1-SW (config-line) #no exec-timeoutsw1-sw (config) #interface range fastethernet  1/0 - 3SW1-SW (Config-if-range) #switchportSW1-sw (config-if-range) #switchport mode TRUNKSW1-SW (Config-if-range) #switchport trunk encapsulation dot1qsw1-sw (config-if-range) #no  SHUSW1-SW (config) #interface range fastethernet 1/1 - 2sw1-sw (config-if-range) # CHANNEL-GROUP 1 MODE ONSW1-SW (config) #vlan 10sw1-sw (config) #vlan 20sw1-sw (config) # VLAN 100SW1-SW (config) #vlan 255sw1-sw (config) #interface vlan 10sw1-sw (config-if) #ip ADD 192.168.10.253 255.255.255.0SW1-SW (config-if) #no shusw1-sw (config) #interface vlan  20SW1-SW (config-if) #ip add 192.168.20.253 255.255.255.0sw1-sw (config-if) #no SHUSW1-SW (config) #interface vlan 100SW1-SW (config-if) #no ip addsw1-sw (config-if) #ip add 192.168.100.1 255.255.255.0  SW1-SW (config-if) #no shusw1-sw (config) #interface vlan 255sw1-sw (config-if) #ip add  192.168.255.1 255.255.255.0SW1-SW (config-if) #no shusw1-sw (config) #service  DHCPSW1-SW ( Config) #ip dhcp relay information optionsw1-sw (config) #interface  VLAN 10SW1-SW ( CONFIG-IF) #ip helper-address 192.168.100.254sw1-sw (config) #interface  VLAN 20SW1-SW ( CONFIG-IF) #ip helper-address 192.168.100.254sw1-sw (config) #vtp mode serversw1-sw (config) # VTP DOMAIN YUTOSW1-SW (config) #vtp password 666sw1-sw (config) #spanning-tree vlan 10 PRIORITY 4096SW1-SW (config) #spanning-TREE VLAN 20 PRIORITY 8192SW1-SW ( CONFIG-IF) #standby  1 IP 192.168.10.1SW1-SW (config-if) #standby 1 priority 255     SW1-SW (config-if) #standby  1 PREEMPT SW1-SW (config-if) #standby 2 ip 192.168.20.1sw1-sw (config) # Access-list 100 deny ip 192.168.10.0 0.0.0.255 192.168.20.0 0.0.0.255sw1-sw (config) #access-list 100 permit ip any anysw1-sw (config) #interface vlan 10SW1-SW (config-if) #ip access-group 100 in sw1-sw (config) #interface fastethernet  1/5SW1-SW (config-if) #ip add 172.16.0.1 255.255.255.0sw1-sw (config-if) #no  SHUSW1-SW ( Config) #router ospf 1sw1-sw (config-router) #network 172.16.0.0 0.0.0.255 area 0SW1-SW (Config-router) #network 192.168.100.0 0.0.0.255 area 1sw1-sw (config-router) #network  192.168.10.0 0.0.0.255 AREA 1SW1-SW (config-router) #network 192.168.20.0 0.0.0.255 area 1sw1-sw#wr
DHCPServer
DHCPServer (config) #no ip routingdhcpserver (config) #no ip domain-lookup dhcpserver ( Config) #line console 0dhcpserver (config-line) #no exec-timeoutdhcpserver (config) #interface F0/0dhcpserver (config-if) #ip add 192.168.100.254 255.255.255.0dhcpserver (config-if) #no Shutdowndhcpserver (config) #ip default-gateway 192.168.100.1dhcpserver (config) #service Dhcpdhcpserver (config) #ip dhcp pool vlan10dhcpserver (dhcp-config) #network 192.168.10.0 /24dhcpserver (dhcp-config) #default-router 192.168.10.1dhcpserver (dhcp-config) #dns-server 8.8.8.8 dhcpserver (config) #ip dhcp pool vlan20dhcpserver (dhcp-config) #network 192.168.20.0 /24dhcpserver (dhcp-config) #default-router 192.168.20.1dhcpserver (dhcp-config) # Dns-server 8.8.8.8dhcpserver (config) #ip dhcp excluded-address 192.168.20.1 dhcpserver (config) #ip dhcp excluded-address 192.168.10.1
R1
R1 (config) #interface fastethernet 2/0r1 (config-if) #ip add 11.11.11.11 255.255.255.0r1 (config) #interface fastethernet 0/0r1 (config-if) #ip add 172.16.0.254 255.255.255.0r1 ( Config) #interface fastethernet 1/0r1 (config-if) #ip add 172.16.1.254 255.255.255.0r1 ( Config) #router ospf 1r1 (config-router) #network 172.16.0.0 0.0.0.255 area 0r1 ( Config-router) #network 172.16.1.0 0.0.0.255 area 0r1 (config) #ip route 0.0.0.0 0.0.0.0 11.11.11.12r1 (config) #router ospf 1r1 (config-router) #default-information OriginateR1 (config) #access-list 1 permit anyr1 (config) #interface f0/0r1 (config-if) #ip nat inside r1 (config) #interface fastethernet 1/0r1 (config-if) #ip nat InsideR1 (config) #interface fastethernet 2/0r1 (config-if) #ip nat outsider1 (config) #ip nat pool yidong 11.11.11.11 11.11.11.11 netmask 255.255.255.0r1 (config) #ip nat inside source list 1 pool yidong overload
R2
R2 (config) #interface fastethernet 0/0r2 (config-if) #ip add 11.11.11.12 255.255.255.0r2 (config) #interface loopback 0r2 ( CONFIG-IF) #ip Add 22.22.22.22 255.255.255.0
Cisco Comprehensive Small Experiment