1.实验拓扑如下:
2.实验要求 :
3.实验配置思路:
1).划分网段
2).先将每台交换机的VLAN创建并划分,再进行trunk干道的定义。
3).再进行每个路由器的IP地址进行配置,给每台路由器进行静态路由的配置、DHCP获取PC1到PC4的IP地址、空接口的设置,优先级的改变,缺省路由。
4).在R5上进行端口映射的配置,并写个将内网指向外网的缺省路由,实现全网可通。
5)在R2上配置telnet。并且通过ACL访问控制列表使仅R1可以telnet登录到R2。
4.配置内容:
交换机SW1:
[SW1]vlan 2
[SW1-vlan2]q
[SW1]vlan 3
[SW1-vlan3]q
[SW1]int Eth0/0/1
[SW1-Ethernet0/0/1]port link-type access
[SW1-Ethernet0/0/1]port default vlan 2
[SW1-Ethernet0/0/1]qu
[SW1]int Eth0/0/2
[SW1-Ethernet0/0/2]port link-type access
[SW1-Ethernet0/0/2]po
[SW1-Ethernet0/0/2]port def
[SW1-Ethernet0/0/2]port default vlan 3
[SW1-Ethernet0/0/2]qu
[SW1]int
[SW1]interface g
[SW1]interface GigabitEthernet 0/0/2
[SW1-GigabitEthernet0/0/2]port link-type trunk
[SW1-GigabitEthernet0/0/2]port trunk allow-pass vlan 2 to 3
[SW1-GigabitEthernet0/0/2]qu
交换机SW2:
[SW2]vlan 2
[SW2-vlan2]q
[SW2]vlan 3
[SW2-vlan3]qu
[SW2]int
[SW2]interface Eth0/0/1
[SW2-Ethernet0/0/1]port link-type access
[SW2-Ethernet0/0/1]po
[SW2-Ethernet0/0/1]port def
[SW2-Ethernet0/0/1]port default vlan 2
[SW2-Ethernet0/0/1]q
[SW2]int
[SW2]interface Eth0/0/2
[SW2-Ethernet0/0/2]port link-type access
[SW2-Ethernet0/0/2]po
[SW2-Ethernet0/0/2]port def
[SW2-Ethernet0/0/2]port default vlan 3
[SW2-Ethernet0/0/2]qu
[SW2]int
[SW2]interface Eth0/0/3
[SW2-Ethernet0/0/3]port link-type access
[SW2-Ethernet0/0/3]po
[SW2-Ethernet0/0/3]port def
[SW2-Ethernet0/0/3]port default vlan 3
[SW2-Ethernet0/0/3]qu
[SW2]int
[SW2]interface g
[SW2]interface GigabitEthernet 0/0/2
[SW2-GigabitEthernet0/0/2]port link-type trunk
[SW2-GigabitEthernet0/0/2]port trunk allow-pass vlan 2 to 3
[SW2-GigabitEthernet0/0/2]qu
路由器R1:
[R1]int
[R1]interface g
[R1]interface GigabitEthernet 0/0/2
[R1-GigabitEthernet0/0/2]qu
[R1]int
[R1]interface g0/0/2.1
[R1-GigabitEthernet0/0/2.1]dot1q termination vid 2
[R1-GigabitEthernet0/0/2.1]ip add
[R1-GigabitEthernet0/0/2.1]ip address 192.168.1.1 28
[R1-GigabitEthernet0/0/2.1]q
[R1]int
[R1]interface g0/0/2.2
[R1-GigabitEthernet0/0/2.2]dot
[R1-GigabitEthernet0/0/2.2]dot1q te
[R1-GigabitEthernet0/0/2.2]dot1q termination vid 3
[R1-GigabitEthernet0/0/2.2]ip add
[R1-GigabitEthernet0/0/2.2]ip address 192.168.1.129 28
Nov 4 2022 16:44:53-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/2.2 has entered the UP state.
[R1-GigabitEthernet0/0/2.2]arp broadcast enable
[R1-GigabitEthernet0/0/2.2]q
[R1]int
[R1]interface g0/0/2.1
[R1-GigabitEthernet0/0/2.1]arp broadcast enable
[R1-GigabitEthernet0/0/2.1]qu
[R1]int
[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]ip add
[R1-GigabitEthernet0/0/0]ip address 192.168.1.129 27
Error: The specified address conflicts with another address.
[R1-GigabitEthernet0/0/0]qu
[R1]int
[R1]interface g0/0/2.2
[R1-GigabitEthernet0/0/2.2]undo ip address 192.168.1.129 28
Nov 4 2022 16:52:08-08:0