实训项目四
任务清单
基础配置
根据实训项目 4-拓扑图和实训项目 4-地址规划表上要求,为每一个PC和接口配置IP地址。
VLAN配置
在交换机上创建vlan,并把vlan划分到相应的接口,SW1的G0/0口为Trunk模式。
子接口配置
在R1上创建GIG0/0的子接口作为VLAN10,20的网关
设备名称 | 端口号 | IP地址 | VLAN |
VPC1 | eth0 | 192.168.47.1/24 | VLAN10 |
VPC2 | eth0 | 192.168.48.1/24 | VLAN20 |
R1 | G0/0.10 | 192.168.47.254/24 | VLAN10 |
R1 | G0/0.20 | 192.168.48.254/24 | VLAN20 |
SWA | G0/0 | 无 | Trunk |
SWA | G0/1 | 无 | VLAN10 |
SWA | G0/2 | 无 | VLAN20 |
下面是每个设备的配置和配置验证截图,一般第一张是配置,有"show"开始为验证截图。最后有一个验证拓扑图各功能ping通的验证。
pc1
VPCS> ip 192.168.47.1 24 192.168.47.254
Checking for duplicate address...
VPCS : 192.168.47.1 255.255.255.0 gateway 192.168.47.254
VPCS> show ip
NAME : VPCS[1]
IP/MASK : 192.168.47.1/24
GATEWAY : 192.168.47.254
DNS :
MAC : 00:50:79:66:68:19
LPORT : 20000
RHOST:PORT : 127.0.0.1:30000
MTU : 1500
VPCS>
pc2
VPCS> ip 192.168.48.1 24 192.168.48.254
Checking for duplicate address...
VPCS : 192.168.48.1 255.255.255.0 gateway 192.168.48.254
VPCS> show ip
NAME : VPCS[1]
IP/MASK : 192.168.48.1/24
GATEWAY : 192.168.48.254
DNS :
MAC : 00:50:79:66:68:1a
LPORT : 20000
RHOST:PORT : 127.0.0.1:30000
MTU : 1500
VPCS>
SW1
Ruijie>en
Password:******
User's password is too weak. Please change the password!
Ruijie#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Ruijie(config)#host SW1
SW1(config)#vlan 10
SW1(config-vlan)#vlan 20 //创建VLAN10,VLAN20
SW1(config-vlan)#exit
SW1(config)#int g0/0 //进入G0/0口
SW1(config-if-GigabitEthernet 0/0)#switchport mode trunk //设置为Trunk口
SW1(config-if-GigabitEthernet 0/0)#int g0/1
SW1(config-if-GigabitEthernet 0/1)#switchport mode access //设置为access口
SW1(config-if-GigabitEthernet 0/1)#switchport access vlan 10 //配置为VLAN10
SW1(config-if-GigabitEthernet 0/1)#int g0/2
SW1(config-if-GigabitEthernet 0/2)#switchport mode access //设置为access口
SW1(config-if-GigabitEthernet 0/2)#switchport access vlan 20 //配置为VLAN20
SW1(config-if-GigabitEthernet 0/2)#exit
SW1(config)#exit
SW1#wr
SW1#show vlan
VLAN Name Status Ports
---------- -------------------------------- --------- -----------------------------------
1 VLAN0001 STATIC Gi0/0, Gi0/3, Gi0/4, Gi0/5
Gi0/6, Gi0/7, Gi0/8
10 VLAN0010 STATIC Gi0/0, Gi0/1
20 VLAN0020 STATIC Gi0/0, Gi0/2
SW1#
R1
Ruijie>en
Password:******
User's password is too weak. Please change the password!
Ruijie#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Ruijie(config)#host R1
R1(config-vlan)#exit
R1(config)#int g0/0 //进入主接口G0/0
R1(config-if-GigabitEthernet 0/0)#no switchport //开启路由功能
R1(config-if-GigabitEthernet 0/0)#exit
R1(config)#int g0/0.10 //进入子接口G0/0.10
R1(config-subif-GigabitEthernet 0/0.10)#encapsulation dot1Q 10 //用802.1q VLAN10封装
R1(config-subif-GigabitEthernet 0/0.10)#ip address 192.168.47.254 24 //添加IP
R1(config-subif-GigabitEthernet 0/0.10)#int g0/0.20 //进入子接口G0/0.20
R1(config-subif-GigabitEthernet 0/0.20)#encapsulation dot1Q 20 //用802.1q VLAN20封装
R1(config-subif-GigabitEthernet 0/0.20)#ip address 192.168.48.254 24 //添加IP
R1(config-subif-GigabitEthernet 0/0.20)#exit
R1(config)#exit
R1#wr
R1#show ip int br
Interface IP-Address(Pri) IP-Address(Sec) Status Protocol
GigabitEthernet 0/0 no address no address up down
GigabitEthernet 0/0.10 192.168.47.254/24 no address up up
GigabitEthernet 0/0.20 192.168.48.254/24 no address up up
VLAN 1
验证截图
VPCS> show ip
NAME : VPCS[1]
IP/MASK : 192.168.47.1/24
GATEWAY : 192.168.47.254
DNS :
MAC : 00:50:79:66:68:19
LPORT : 20000
RHOST:PORT : 127.0.0.1:30000
MTU : 1500
VPCS> ping 192.168.48.1
84 bytes from 192.168.48.1 icmp_seq=1 ttl=63 time=36.789 ms
84 bytes from 192.168.48.1 icmp_seq=2 ttl=63 time=2.692 ms
84 bytes from 192.168.48.1 icmp_seq=3 ttl=63 time=2.997 ms
84 bytes from 192.168.48.1 icmp_seq=4 ttl=63 time=2.524 ms
84 bytes from 192.168.48.1 icmp_seq=5 ttl=63 time=2.949 ms
VPCS>