单臂路由实验

此实验是一个简单的单臂路由实验,实验中用到了一个cisco路由器和一个cisco交换机;交换机上配置了两个vlan,即vlan2 和vlan3,f0/24配置成trunk;路由器的f0/0连接到交换机的trunk。
路由器的配置好下:
Router#show running-config
Building configuration...
Current configuration : 475 bytes
!
version 12.2
no service password-encryption
!
hostname Router
!
!
!
!
!
ip ssh version 1
!
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.2     定义子接口,子接口名称和此接口所属VLAN相同
 encapsulation dot1Q 2           封装协议
 ip address 1.1.1.1 255.0.0.0     配置IP地址
!
interface FastEthernet0/0.3
 encapsulation dot1Q 3
 ip address 172.16.0.1 255.255.0.0
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
ip classless
!
!
!
!
!
line con 0
line vty 0 4
 login
!
!
end
在路由器中的配置中,个人觉得应注意一点,就是cisco设备在默认时每个接口都是down的,所以在进行子接口的配置时先要对物理接口进行no shutdown,而在华为设备中则不需要,因为在华为设备中默认时接口都是活动的。
交换机中的配置好下:
Switch#show running-config
Building configuration...
Current configuration : 1000 bytes
!
version 12.2
no service password-encryption
!
hostname Switch
!
!
!
interface FastEthernet0/1
 switchport access vlan 2
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
 switchport access vlan 3
!
interface FastEthernet0/24
 switchport mode trunk
!
interface GigabitEthernet1/1
!
interface GigabitEthernet1/2
!
interface Vlan1
 no ip address
 shutdown
!
line con 0
!
line vty 0 4
 login
line vty 5 15
 login
!
!
end
最后进行测试:
PC>ping 172.16.0.2
Pinging 172.16.0.2 with 32 bytes of data:
Reply from 172.16.0.2: bytes=32 time=110ms TTL=127
Reply from 172.16.0.2: bytes=32 time=125ms TTL=127
Reply from 172.16.0.2: bytes=32 time=234ms TTL=127
Reply from 172.16.0.2: bytes=32 time=125ms TTL=127
Ping statistics for 172.16.0.2:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 110ms, Maximum = 234ms, Average = 148ms
实验成功!!!

你可能感兴趣的:(职场,休闲,CCNA)