一、结合以下问题对当天内容进行总结
答:有3种方法。方法1:使用路由器的物理接口作为网关,一个VLAN对应一个物理接口,转发流量;方法2:使用路由器子接口作为网关,一个VLAN对应一个子接口,转发流量;方法3:SVI技术,使用三层交换机的VLANIF接口作为网关,一个VLAN对应一个VLANIF接口,转发流量。
2. 三层交换机的工作原理?
这个你知道吗?
3. 三层交换机能否取代路由器,为什么?
这个你知道吗?
4. 简单说明生成树的工作原理
答:在二层交换网络中,逻辑上阻塞部分接口,实现从根交换机到所有节点唯一的路径且为最佳路径,生成一个没有环路的拓扑。当最佳路径出现故障时,个别被阻塞的接口将打开,形成备份链路。
5. 交换机组网为什么会产生环路?
答:以太网交换网络中为了进行链路备份,提高网络可靠性,通常会使用冗余链路。但是使用冗余链路会在交换网络上产生环路
6. 交换机环路会导致哪些问题?
答:1、广播风暴 2、MAC地址表漂移 3、多帧复制
7. 园区网组网两个基本思路是什么?
答:层次化、模块化
二、园区网组网实验
【实验题目】
做通私网,并进行优化
LSW1、LSW4、LSW7是三层交换机,其余交换机均为二层交换机,PC使用DHCP获取IP地址
VLAN | 设备 | 网关(IP地址) |
VLAN 2 | PC1 | LSW1,VLANIF2:192.168.2.254/24 |
PC2 | ||
LSW2/LSW1 | - | |
VLAN 3 | PC3 | LSW1,VLANIF3:192.168.3.254/24 |
LSW3/LSW1 | - | |
VLAN 4 | PC4 | LSW1,VLANIF4:192.168.4.254/24 |
LSW3/LSW1 | - | |
VLAN 5 | PC5 | LSW4,VLANIF5:192.168.5.254/24 |
PC6 | ||
LSW5/LSW4 | - | |
VLAN 6 | PC7 | LSW4,VLANIF6:192.168.6.254/24 |
LSW6/LSW4 | - | |
VLAN 7 | PC8 | LSW4,VLANIF7:192.168.7.254/24 |
LSW6/LSW4 | - | |
VLAN 1000 | LSW1/LSW7 |
LSW1,VLANIF1000:192.168.17.1/30 LSW7,VLANIF1000:192.168.17.2/30 |
VLAN 1001 | LSW4/LSW7 |
LSW4,VLANIF1001:192.168.47.1/30 LSW7,VLANIF1001:192.168.47.2/30 |
VLAN 1002 | LSW7 | LSW7,VLANIF1002:192.168.71.1/30 |
【实验思路】
分层做,自下而上,先做接入层,再做汇聚层,然后做核心层LSW7和AR1,核心层使用OSPF协议,AR1与LSW7之间是骨干区域,私网1为区域1,私网2是区域2,PC使用DHCP获取IP地址,使用OSPF下发缺省。优化:做特殊区域,更改接口网络类型为P2P。
【实验记录】
一、接入层
[SW2]vlan 2 [SW2-vlan2]q [SW2]int g0/0/2 [SW2-GigabitEthernet0/0/2]port link-type access [SW2-GigabitEthernet0/0/2]port default vlan 2 [SW2-GigabitEthernet0/0/2]int g0/0/3 [SW2-GigabitEthernet0/0/3]port link-type access [SW2-GigabitEthernet0/0/3]port default vlan 2 [SW2-GigabitEthernet0/0/3]int g0/0/1 [SW2-GigabitEthernet0/0/1]port link-type trunk [SW2-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 [SW2-GigabitEthernet0/0/1]undo port trunk allow-pass vlan 1
[SW3]vlan batch 3 4 [SW3]int g0/0/2 [SW3-GigabitEthernet0/0/2]port link-type access [SW3-GigabitEthernet0/0/2]port default vlan 3 [SW3-GigabitEthernet0/0/2]int g0/0/3 [SW3-GigabitEthernet0/0/3]port link-type access [SW3-GigabitEthernet0/0/3]port default vlan 4 [SW3-GigabitEthernet0/0/3]int g0/0/1 [SW3-GigabitEthernet0/0/1]port link-type trunk [SW3-GigabitEthernet0/0/1]port trunk allow-pass vlan 3 4 [SW3-GigabitEthernet0/0/1]undo port trunk allow-pass vlan 1
[SW5]vlan 5 [SW5-vlan5]q [SW5]int g0/0/2 [SW5-GigabitEthernet0/0/2]port link-type access [SW5-GigabitEthernet0/0/2]port default vlan 5 [SW5-GigabitEthernet0/0/2]int g0/0/3 [SW5-GigabitEthernet0/0/3]port link-type access [SW5-GigabitEthernet0/0/3]port default vlan 5 [SW5-GigabitEthernet0/0/3]int g0/0/1 [SW5-GigabitEthernet0/0/1]port link-type trunk [SW5-GigabitEthernet0/0/1]port trunk allow-pass vlan 5 [SW5-GigabitEthernet0/0/1]undo port trunk allow-pass vlan 1
[SW6]vlan batch 6 7 [SW6]int g0/0/2 [SW6-GigabitEthernet0/0/2]port link-type access [SW6-GigabitEthernet0/0/2]port default vlan 6 [SW6-GigabitEthernet0/0/2]int g0/0/3 [SW6-GigabitEthernet0/0/3]port link-type access [SW6-GigabitEthernet0/0/3]port default vlan 7 [SW6-GigabitEthernet0/0/3]int g0/0/1 [SW6-GigabitEthernet0/0/1]port link-type trunk [SW6-GigabitEthernet0/0/1]port trunk allow-pass vlan 6 7 [SW6-GigabitEthernet0/0/1]undo port trunk allow-pass vlan 1
二、汇聚层
[SW1]vlan batch 2 3 4 1000 [SW1]int g0/0/2 [SW1-GigabitEthernet0/0/2]port link-type trunk [SW1-GigabitEthernet0/0/2]port trunk allow-pass vlan 2 [SW1-GigabitEthernet0/0/2]undo port trunk allow-pass vlan 1 [SW1-GigabitEthernet0/0/2]int g0/0/3 [SW1-GigabitEthernet0/0/3]port link-type trunk [SW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 3 4 [SW1-GigabitEthernet0/0/3]undo port trunk allow-pass vlan 1 [SW1-GigabitEthernet0/0/3]int g0/0/1 [SW1-GigabitEthernet0/0/1]port link-type access [SW1-GigabitEthernet0/0/1]port default vlan 1000 [SW1-GigabitEthernet0/0/1]q [SW1]dhcp enable [SW1]int Vlanif 2 [SW1-Vlanif2]ip address 192.168.2.254 24 [SW1-Vlanif2]dhcp select interface [SW1-Vlanif2]q [SW1]int Vlanif 3 [SW1-Vlanif3]ip address 192.168.3.254 24 [SW1-Vlanif3]dhcp select interface [SW1-Vlanif3]q [SW1]int Vlanif 4 [SW1-Vlanif4]ip address 192.168.4.254 24 [SW1-Vlanif4]dhcp select interface [SW1-Vlanif4]q [SW1]int Vlanif 1000 [SW1-Vlanif1000]ip address 192.168.17.1 30
[SW4]vlan batch 5 6 7 1001 [SW4]int g0/0/2 [SW4-GigabitEthernet0/0/2]port link-type trunk [SW4-GigabitEthernet0/0/2]port trunk allow-pass vlan 5 [SW4-GigabitEthernet0/0/2]undo port trunk allow-pass vlan 1 [SW4-GigabitEthernet0/0/2]int g0/0/3 [SW4-GigabitEthernet0/0/3]port link-type trunk [SW4-GigabitEthernet0/0/3]port trunk allow-pass vlan 6 7 [SW4-GigabitEthernet0/0/3]undo port trunk allow-pass vlan 1 [SW4-GigabitEthernet0/0/3]int g0/0/1 [SW4-GigabitEthernet0/0/1]port link-type access [SW4-GigabitEthernet0/0/1]port default vlan 1001 [SW4-GigabitEthernet0/0/1]q [SW4]dhcp enable [SW4]int Vlanif 5 [SW4-Vlanif5]ip address 192.168.5.254 24 [SW4-Vlanif5]dhcp select interface [SW4-Vlanif5]q [SW4]int Vlanif 6 [SW4-Vlanif6]ip address 192.168.6.254 24 [SW4-Vlanif6]dhcp select interface [SW4-Vlanif6]q [SW4]int Vlanif 7 [SW4-Vlanif7]ip address 192.168.7.254 24 [SW4-Vlanif7]dhcp select interface [SW4-Vlanif7]q [SW4]int Vlanif 1001 [SW4-Vlanif1001]ip address 192.168.47.1 30
此时私网1内部可通,私网2内部可通,私网1与私网2之间不可通
三、核心层
[SW7]vlan batch 1000 1001 1002 [SW7]int g0/0/1 [SW7-GigabitEthernet0/0/1]port link-type access [SW7-GigabitEthernet0/0/1]port default vlan 1000 [SW7-GigabitEthernet0/0/1]int g0/0/2 [SW7-GigabitEthernet0/0/2]port link-type access [SW7-GigabitEthernet0/0/2]port default vlan 1001 [SW7-GigabitEthernet0/0/2]int g0/0/4 [SW7-GigabitEthernet0/0/4]port link-type access [SW7-GigabitEthernet0/0/4]port default vlan 1002 [SW7-GigabitEthernet0/0/4]q [SW7]int Vlanif 1000 [SW7-Vlanif1000]ip address 192.168.17.2 30 [SW7-Vlanif1000]q [SW7]int Vlanif 1001 [SW7-Vlanif1001]ip address 192.168.47.2 30 [SW7-Vlanif1001]q [SW7]int Vlanif 1002 [SW7-Vlanif1002]ip address 192.168.71.1 30
四、R1
[r1]int g0/0/0 [r1-GigabitEthernet0/0/0]ip address 192.168.71.2 30
五、配置OSPF
[r1]ospf 1 router-id 11.11.11.11 [r1-ospf-1]a 0 [r1-ospf-1-area-0.0.0.0]network 192.168.71.0 0.0.0.3
[SW1]ospf 1 router-id 1.1.1.1 [SW1-ospf-1]a 1 [SW1-ospf-1-area-0.0.0.1]network 192.168.2.0 0.0.0.255 [SW1-ospf-1-area-0.0.0.1]network 192.168.3.0 0.0.0.255 [SW1-ospf-1-area-0.0.0.1]network 192.168.4.0 0.0.0.255 [SW1-ospf-1-area-0.0.0.1]network 192.168.17.0 0.0.0.3
[SW4]ospf 1 router-id 4.4.4.4 [SW4-ospf-1]a 2 [SW4-ospf-1-area-0.0.0.2]network 192.168.5.0 0.0.0.255 [SW4-ospf-1-area-0.0.0.2]network 192.168.6.0 0.0.0.255 [SW4-ospf-1-area-0.0.0.2]network 192.168.7.0 0.0.0.255 [SW4-ospf-1-area-0.0.0.2]network 192.168.47.0 0.0.0.3
[SW7]ospf 1 router-id 7.7.7.7 [SW7-ospf-1]a 0 [SW7-ospf-1-area-0.0.0.0]network 192.168.71.0 0.0.0.3 [SW7-ospf-1-area-0.0.0.0]q [SW7-ospf-1]a 1 [SW7-ospf-1-area-0.0.0.1]network 192.168.17.0 0.0.0.3 [SW7-ospf-1-area-0.0.0.1]q [SW7-ospf-1]a 2 [SW7-ospf-1-area-0.0.0.2]network 192.168.47.0 0.0.0.3
此时,私网1与私网2之间可互通
且可连通R1
六、下发缺省及OSPF优化
[r1-ospf-1]default-route-advertise always
特殊区域:
[SW1-ospf-1-area-0.0.0.1]stub [SW4-ospf-1-area-0.0.0.2]stub [SW7-ospf-1-area-0.0.0.1]stub no-summary [SW7-ospf-1-area-0.0.0.2]stub no-summary
更改接口网络类型:
[SW1]int Vlanif 1000 [SW1-Vlanif1000]ospf network-type p2p
[SW4]int Vlanif 1001 [SW4-Vlanif1001]ospf network-type p2p
[r1]int g0/0/0 [r1-GigabitEthernet0/0/0]ospf network-type p2p
[SW7]int Vlanif 1000 [SW7-Vlanif1000]ospf network-type p2p [SW7]int Vlanif 1001 [SW7-Vlanif1001]ospf network-type p2p [SW7]int Vlanif 1002 [SW7-Vlanif1002]ospf network-type p2p
至此,实验完毕。
审核编辑:黄飞
评论
查看更多