Summary of Computer Network Experiment

Lab 1 switch sets password, assigns ip address of vlan

Experimentation Requirements

  1. Create a VLAN and configure its ip
  2. Set enable password
  3. Set Remote Logon Password

Configuration Command

Switch>enable
"Enter privileged mode to view various configurations of switches"
Switch#conf t
"conf t yes configure terminal Abbreviation for, into global configuration mode"
Switch(config)#enable password 123
"Set Privilege Mode(Enable Control)Password"
Switch(config)#line vty 0 4
Switch(config-line)#password 456
"Set up remote login telnet Password"
Switch(config-line)#int vlan 1
Switch(config-if)#ip add 192.168.1.254 255.255.255.0
"Set up vlan 1 Of ip address"

Switch#show run
"You can view the configuration and password of each interface"
...
!
hostname Switch
!
enable password 123
!
...
!
interface Vlan1
 ip address 192.168.1.254 255.255.255.0
 shutdown
!
line con 0
!
line vty 0 4
 password 456
 login
line vty 5 15
 login
!

Summary:

  • Computer interface to switch can be logged on remotely after being divided into a vlan
  • To log on to a switch remotely at the terminal telnet, you must first configure the ip address of the vlan in the switch, the remote login, the enabled password
  • All interfaces of the switch are divided by default in vlan 1
  • The write directive saves the configuration file of the current switch
  • no vlan number deletes corresponding vlan
  • Similar network devices are connected by crossover lines, while different network devices are connected by straight lines
  • Computers and switches are different types of devices, connected by a straight line
  • Ports that support MDI/MDIX auto-flipping (i.e. auto-adapting interface type), whether straight or crossed, will work
  • Auto-flip is currently supported in most network devices and network terminals.

Lab 2 Single Switch vlan Configuration

Experimentation Requirements

  1. Create multiple VLAN s

  2. Can communicate between the same VLAN, not between different VLANs

Configuration Command

Switch>enable
Switch#conf t
Switch(config)#int range f0/1-2
"int yes interface Abbreviations for, plus range Can enter a range"
Switch(config-if-range)#switch mode access
Switch(config-if-range)#switch access vlan 10
Switch(config-if-range)#int ra f0/3-4
Switch(config-if-range)#switch mode access
Switch(config-if-range)#switch access vlan 20

Switch#show run
...
!
interface FastEthernet0/1
 switchport access vlan 10
 switchport mode access
!
interface FastEthernet0/2
 switchport access vlan 10
 switchport mode access
!
interface FastEthernet0/3
 switchport access vlan 20
 switchport mode access
!
interface FastEthernet0/4
 switchport access vlan 20
 switchport mode access
!
...

Summary:

  • The show running command can view the current configuration, such as the working mode of each interface, ip address, and various passwords
  • range can be used to divide multiple interfaces for the same vlan
  • Can communicate between the same vlan, not between different VLANs
  • In this experiment I did not set the ip address and configure the password for vlan

Lab 3 Multi-switch vlan configuration

Experimentation Requirements

  1. There are two or more switches
  2. Create multiple VLANs
  3. Can communicate between the same vlan, not between different VLANs

Configuration Command

I just posted the switch 1 command, switch 2 is much the same

Switch>enable 
Switch#conf t
Switch(config)#hostname r1
r1(config)#int f0/1
r1(config-if)#switch mode access
r1(config-if)#switchport access vlan 10
r1(config-if)#int f0/2
r1(config-if)#switch mode access
r1(config-if)#switchport access vlan 20
r1(config-if)#int g1/2
r1(config-if)#switch mode trunk
"Interface open for connection between switches trunk Patterns, which can be divided together vlan"
r1(config-if)#switch trunk allowed vlan 10,20
"Set the interface allowed to pass through vlan,allowed Cannot omit"
r1(config-if)#end
r1#show run
...
!
interface FastEthernet0/1
 switchport access vlan 10
 switchport mode access
!
interface FastEthernet0/2
 switchport access vlan 20
 switchport mode access
!
...
!
interface GigabitEthernet1/2
 switchport trunk allowed vlan 10,20
 switchport mode trunk
!
...

Summary

  • Can't communicate between different VLANs
  • This is a multi-switch experiment. I think the most critical commands are switch mode trunk and switch trunk allowed vlan all, where allowed cannot be omitted, which is different from access mode. Another is that vlan all can be replaced by vlan 10,20 to specify the allowable vlan through the interface; Or switch to a range like vlan 1-10

Layer 4 Switch Routing Function

Experimentation Requirements

  1. Routing using a three-layer switch

  2. Communicate between different VLAN s using a three-layer switch

Layer 3 Switch Configuration Command

Switch>enable
Switch#conf t
Switch(config)#int f0/1
Switch(config-if)#switch mode access 
Switch(config-if)#switch access vlan 10
% Access VLAN does not exist. Creating vlan 10
Switch(config-if)#ip address 192.168.1.254 255.255.255.0
                  ^
% Invalid input detected at '^' marker.
"This place I thought was for interface configuration IP Address, then the switch will respond in vlan To configure ip"
Switch(config-if)#int vlan 10
Switch(config-if)#ip address 192.168.1.254 255.255.255.0
Switch(config-if)#int f0/2
Switch(config-if)#switch mode access
Switch(config-if)#swit access vlan 20
Switch(config-if)#int vlan 20
Switch(config-if)#ip add 10.0.0.254 255.0.0.0 
"A,B,C class ip Address default subnet mask is different"
Switch(config-if)#int g0/2
Switch(config-if)#switch mode trunk
Command rejected: An interface whose trunk encapsulation is "Auto" can not be configured to "trunk" mode.
"Here I open the interface trunk Mode failed, probably because I haven't configured a Layer 2 switch yet"
Switch(config-if)#switch trunk allowed vlan all
Switch(config-if)#end
Switch#show run
"I just intercepted what I thought was important"
!
interface FastEthernet0/1
 switchport access vlan 10
 switchport mode access
!
interface FastEthernet0/2
 switchport access vlan 20
 switchport mode access
!
interface GigabitEthernet0/2
!
interface Vlan10
 ip address 192.168.1.254 255.255.255.0
!
interface Vlan20
 ip address 10.0.0.254 255.0.0.0
!

Layer 2 Switch Configuration Command

Switch>enable
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int f0/1
Switch(config-if)#switch mode access 
Switch(config-if)#switch access vlan 10
% Access VLAN does not exist. Creating vlan 10
Switch(config-if)#int f0/2
Switch(config-if)#switch mode access
Switch(config-if)#switch access vlan 20
% Access VLAN does not exist. Creating vlan 20
Switch(config-if)#int f0/3
Switch(config-if)#switch mode access
Switch(config-if)#switch access vlan 20
Switch(config-if)#int g1/2
Switch(config-if)#switch mode trunk
Switch(config-if)#switch  trunk allowed vlan all
Switch(config-if)#end
Switch#show run

Summary

  • After configuring the switch, you need the computer to set a static ip address. The default gateway is the ip address of the corresponding vlan
  • Communication between different VLANs can be achieved

Experiment 5 Direct Connect Routing

Experimentation Requirements

  1. Configure ip addresses for interfaces that connect computers

  2. Communication between computers

Router>enable
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int f0/0
Router(config-if)#ip add 192.168.1.254 255.255.255.0
Router(config-if)#no shut
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#int f0/1
Router(config-if)#ip add 192.168.2.254 255.255.255.0
Router(config-if)#no shut
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Router(config-if)#end
Router#show run
"My interface configuration on the Layer 3 switch ip Address failed, but succeeded on Router"
!
interface FastEthernet0/0
 ip address 192.168.1.254 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.2.254 255.255.255.0
 duplex auto
 speed auto
!

Summary

  • The default gateway for the computer is the ip address for the corresponding interface
  • Note that the ip address network number of the default gateway and computer should be the same
  • Computers and routers belong to the same kind of network devices and are connected by crossover lines
  • When configured, the two computers can communicate with each other

Experiment 6 Static Routing

Experimentation Requirements

  1. Master static routing configuration

Left Route Configuration Command

Router>enable
Router#conf t
Router(config)#int f0/0
Router(config-if)#ip add 192.168.1.254 255.255.255.0
Router(config-if)#no shut
Router(config-if)#int f0/1
Router(config-if)#ip add 192.168.2.254 255.255.255.0
Router(config-if)#no shut
Router(config-if)#int f1/1 
Router(config-if)#ip add 192.168.3.254 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#end
Router#show run
!
interface FastEthernet0/0
 ip address 192.168.1.254 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.2.254 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet1/1
 ip address 192.168.3.254 255.255.255.0
 duplex auto
 speed auto
!
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ip route 192.168.4.0 255.255.255.0 192.168.3.253
"The format for configuring static routes is ip route Target Network Number Subnet Mask Next Jump ip"
Router(config)#exit
Router#show ip route
"This command can view the router table of the current router"
C    192.168.1.0/24 is directly connected, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/1
C    192.168.3.0/24 is directly connected, FastEthernet1/1
S    192.168.4.0/24 [1/0] via 192.168.3.253
"s Beginning with the static route I configured, c Begins with direct-connect routing"

Right Router Configuration Command

Router>enable
Router#conf t
Router(config)#int f0/1
Router(config-if)#ip add 192.168.3.253 255.255.255.0
Router(config-if)#no shut
Router(config-if)#int f0/0
Router(config-if)#ip address 192.168.4.254 255.255.255.0
Router(config-if)#no shut
Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.254
Router(config)#ip route 192.168.2.0 255.255.255.0 192.168.3.254
Router(config)#exit
Router#show ip route
S    192.168.1.0/24 [1/0] via 192.168.3.254
S    192.168.2.0/24 [1/0] via 192.168.3.254
C    192.168.3.0/24 is directly connected, FastEthernet0/1
C    192.168.4.0/24 is directly connected, FastEthernet0/0
  • To communicate between two routers, you need to configure static routing or enable rip (Dynamic Routing Protocol)
  • The format for configuring static routes is ip route destination network number subnet mask Next hop ip
  • Both routers are configured with static routes to communicate

Experiment 7 rip Protocol-Dynamic Routing

Experimentation Requirements

  1. Learn how to open rip protocols

Configuration Command

I only posted the leftmost router configuration command, other things are the same or different

Router>enable
Router#conf t
Router(config)#int f0/0 
Router(config-if)#ip add 192.168.1.254 255.255.255.0
Router(config-if)#no shut
Router(config-if)#int f0/1
Router(config-if)#ip add 192.168.2.254 255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#router rip
"open rip Agreement, then network Each interface network number will automatically generate the routing table"
Router(config-router)#network 192.168.1.0
Router(config-router)#network 192.168.2.0
Router(config-router)#end
Router#show ip route
C    192.168.1.0/24 is directly connected, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/1
R    192.168.3.0/24 [120/1] via 192.168.2.253, 00:00:08, FastEthernet0/1
R    192.168.4.0/24 [120/1] via 192.168.2.253, 00:00:08, FastEthernet0/1
R    192.168.5.0/24 [120/2] via 192.168.2.253, 00:00:08, FastEthernet0/1

Summary

  • Open the rip protocol by executing router rip
  • The network number of each interface of the network work will automatically generate the routing table, no longer need to configure static routing

Experiment 8 One-arm Routing

Experimentation Requirements

  1. Communication between different VLANs using router single port

Switch Configuration Command

Switch>enable
Switch#int f0/1	
Switch#conf t
Switch(config)#int f0/1
Switch(config-if)#swit mode access
Switch(config-if)#swit acc vlan 10
Switch(config-if)#int f0/2
Switch(config-if)#swit mod acc
Switch(config-if)#swi acc vlan 20
Switch(config-if)#int gi 1/2
Switch(config-if)#swit mode trunk
Switch(config-if)#switch trunk allowed vlan 10-20
Switch(config-if)#end
Switch#show run
!
interface FastEthernet0/1
 switchport access vlan 10
 switchport mode access
!
interface FastEthernet0/2
 switchport access vlan 20
 switchport mode access
!
interface GigabitEthernet1/2
 switchport trunk allowed vlan 10-20
 switchport mode trunk
!

Router Configuration Command

Router>enable 
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int f0/1
Router(config-if)#no shut
Router(config-if)#int f0/1.1
"On physical port f0/1 Add one after the interface.1 Enter Logical Interface Configuration Mode"
Router(config-subif)#encapsulation dot1Q 10
"Connect the logical interface with the number 10 vlan Relation"
Router(config-subif)#ip add 192.168.2.254 255.255.255.0
"Configuring logical interfaces ip,this ip Address is the corresponding vlan Default gateway for computers on"
Router(config-subif)#int f0/1.2
Router(config-subif)#encapsulation do 20
Router(config-subif)#ip add 192.168.2.254 255.255.255.0
Router(config-subif)#end
Router#show run
!
interface FastEthernet0/1.1
 encapsulation dot1Q 10
 ip address 192.168.1.254 255.255.255.0
!
interface FastEthernet0/1.2
 encapsulation dot1Q 20
 ip address 192.168.2.254 255.255.255.0
!

Summary

  • The switch port to which the router is connected must be a shared port, so set it to trunk mode
  • One-arm routing solves the problem of dynamic change of vlan number
  • How it works: A single physical port is decomposed into multiple logical interfaces, each of which binds a vlan

Posted by sleightofhand on Mon, 02 May 2022 15:35:16 +0300