哈哈距离上一次更新已经20多天了 最近在忙学校的几个课设答辩 虽然不是很难 但是还是挺耗时费力的了 还剩最后一个python网络编程就结束啦 相对于之前几个学期的魔鬼复习还是比较轻松的 这真是一晃又放暑假了
传一个这次的课设作业吧
综合运用所学知识,解决网络设计中的地址规划和具体问题配置,满足使用需求。
二、实验要求
此公司办公区域楼层一共有三层,要求组建一个可供1000人同时上网的局域网。
1.自行设计网络内部所有的ip地址,设计完成之后制定一个表格记录此网络的ip地址,方便以后查询使用;
2.公司一共分成了4个vlan,
vlan 10给财务部门使用;
vlan 20给办公员工使用;
vlan 30给管理部门使用;
vlan 40给访客使用;
3.为了方便管理,各个vlan所在网段的网关安排如下:
vlan 10的网关在sw1上;
vlan 20的网关在sw1上;
vlan 30的网关在sw1上;
vlan 40的网关在sw2上;
4.访客用户在接入网络的时候使用dhcp,dhcp server在R1上;
4.另外的组网需求就是要求内部三层网络使用ospf路由协议达到全网互联;
5.还有一个小公司为了节约成本,没有从运营商接网络,而是租用本公司的网络,小公司用的路由协议都是ripv2。
(1)先配置LSW3 LSW4 LSW5 LSW6
LSW3
u t m
Info: Current terminal monitor is off.
sys
system-view
Enter system view, return user view with Ctrl+Z.
u t m
Info: Current terminal monitor is off.
sys
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]vlan batch 10 30
[Huawei]int e0/0/4
[Huawei-Ethernet0/0/4]port link-type acc
[Huawei-Ethernet0/0/4]port default vlan 10
[Huawei-Ethernet0/0/4]int e0/0/5
[Huawei-Ethernet0/0/5]port link-type acc
[Huawei-Ethernet0/0/5]port default vlan 30
[Huawei-Ethernet0/0/5]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type trunk
[Huawei-Ethernet0/0/1]port trunk allow-pass vlan all
[Huawei-Ethernet0/0/1]int Eth-Trunk 1
[Huawei-Eth-Trunk1]q
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/2]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-Ethernet0/0/2]int e0/0/3
[Huawei-Ethernet0/0/3]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment…done.
LSW4
[Huawei]vlan batch 10 20
[Huawei]int e0/0/4
[Huawei-Ethernet0/0/4]port link-type acc
[Huawei-Ethernet0/0/4]port default vlan 10
[Huawei-Ethernet0/0/4]int e0/0/5
[Huawei-Ethernet0/0/5]port link-type acc
[Huawei-Ethernet0/0/5]port default vlan 20
[Huawei-Ethernet0/0/5]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type trunk
[Huawei-Ethernet0/0/1]port trunk allow-pass vlan all
[Huawei-Ethernet0/0/1]int Eth-Trunk 1
[Huawei-Eth-Trunk1]q
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/2]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-Ethernet0/0/2]int e0/0/3
[Huawei-Ethernet0/0/3]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-Ethernet0/0/3]
LSW5
u t m
Info: Current terminal monitor is off.
sys
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]vlan batch 20 40
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/2]port li-ty
[Huawei-Ethernet0/0/2]port link-ty
[Huawei-Ethernet0/0/2]port link-type acc
[Huawei-Ethernet0/0/2]port default vlan 20
[Huawei-Ethernet0/0/2]int e0/0/3
[Huawei-Ethernet0/0/3]port link-type acc
[Huawei-Ethernet0/0/3]port default vlan 40
[Huawei-Ethernet0/0/3]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type trunk
[Huawei-Ethernet0/0/1]port trunk allow-pass vlan 20 40
LSW6
u t m
Info: Current terminal monitor is off.
sys
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/2]port link-type acc
[Huawei-Ethernet0/0/2]port default vlan 100
[Huawei-Ethernet0/0/2]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type trunk
[Huawei-Ethernet0/0/1]port trunk allow-pass vlan 100
[Huawei-Ethernet0/0/1]port trunk pvid vlan 100
[Huawei-Ethernet0/0/1]
(2)配置 租用网络部分的R2 R3 RIP
R2
[Huawei]int e0/0/0
[Huawei-Ethernet0/0/0]ip address 10.0.0.10 30
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]ip address 10.0.0.17 30
[Huawei]rip1
[Huawei-rip-1]version2
[Huawei-rip-1]network 10.0.0.0
R3
[Huawei]vlan batch100
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]ip address 192.168.5.1 24
[Huawei]int e0/0/0
[Huawei-Ethernet0/0/0]ip address 10.0.0.18 30
[Huawei-Ethernet0/0/0]q
[Huawei]rip
[Huawei-rip-1]version 2
[Huawei-rip-1]network 10.0.0.0
[Huawei-rip-1]network 192.168.5.0
(3)LSW1配置三层接口 RIP OSPF
配置OSPF重分发
[Huawei]vlan batch 10 20 30 70 80 90
[Huawei]int g0/0/4
[Huawei-GigabitEthernet0/0/4]port link-type trunk
[Huawei-GigabitEthernet0/0/4]port trunk allow-pass vlan all
[Huawei]int g0/0/5
[Huawei-GigabitEthernet0/0/5]port link-type trunk
[Huawei-GigabitEthernet0/0/5]port trunk allow-pass vlan all
[Huawei]int g0/0/6
[Huawei-GigabitEthernet0/0/6]port link-type trunk
[Huawei-GigabitEthernet0/0/6]port trunk allow-pass vlan all
[Huawei-GigabitEthernet0/0/6]port trunk pvid vlan 80
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 90
[Huawei-GigabitEthernet0/0/1]port trunk pvid vlan 90
[Huawei]int Vlanif 10
[Huawei-Vlanif10]ip address 192.168.1.1 24
[Huawei]int Vlanif 20
[Huawei-Vlanif20]ip address 192.168.2.1 24
[Huawei]int Vlanif 30
[Huawei-Vlanif30]ip address 192.168.3.1 24
[Huawei]int Vlanif 70
[Huawei-Vlanif70]ip address 10.0.0.13 30
[Huawei]int Vlanif 80
[Huawei-Vlanif80]ip address 10.0.0.9 30
[Huawei]int Vlanif 90
[Huawei-Vlanif90]ip address 10.0.0.6 30
[Huawei]int Eth-Trunk 1
[Huawei-Eth-Trunk1]q
[Huawei]int g 0/0/2
[Huawei-GigabitEthernet0/0/2]eth-trunk 1
[Huawei]int g 0/0/3
[Huawei-GigabitEthernet0/0/3]eth-trunk 1
[Huawei-GigabitEthernet0/0/3]q
[Huawei]int Eth-Trunk 1
[Huawei-Eth-Trunk1]port link-type trunk
[Huawei-Eth-Trunk1]port trunk allow-pass vlan all
[Huawei-Eth-Trunk1]q
[Huawei]router id 10.2.2.2
[Huawei]ospf 1
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 10.0.0.8 0.0.0.3
[Huawei-ospf-1-area-0.0.0.0]network 10.0.0.4 0.0.0.3
[Huawei-ospf-1-area-0.0.0.0]network 10.0.0.12 0.0.0.3
[Huawei]rip
[Huawei-rip-1]version 2
[Huawei-rip-1]undo summary
[Huawei-rip-1]network 10.0.0.0
重分发
[Huawei]ospf
[Huawei-ospf-1]import-routerip
[Huawei]rip
[Huawei-rip-1]import-routeospf
(4)配置交换机与R1与R4
R1
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]ip address 10.0.0.5 30
[Huawei]int LoopBack 0
[Huawei-LoopBack0]ip address 10.1.1.1 24
[Huawei]ospf 1
[Huawei]router id 10.1.1.1
[Huawei-ospf-1-area-0.0.0.0]network 10.0.0.6 0.0.0.3
[Huawei-ospf-1-area-0.0.0.0]network 0.0.0.0 0.0.0.0
[Huawei]dhcp enable
[Huawei]ip pool 1
[Huawei-ip-pool-1]network 192.168.4.0 mask 24
[Huawei-ip-pool-1]gateway-list 192.168.4.1
[Huawei-ip-pool-1]dns-list 8.8.8.8
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]dhcp select global
R4
[Huawei]ip route-static 0.0.0.0 0.0.0.0 202.112.1.2
[Huawei]int e0/0/0
[Huawei-Ethernet0/0/0]ip add 202.112.1.1 24
(5)使R1作为 DHCP server 与R4互联
R1
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]ip address 10.0.0.5 30
[Huawei]int e0/0/0
[Huawei-Ethernet0/0/0]ip add 202.112.1.1 24
[Huawei]int LoopBack 0
[Huawei-LoopBack0]ip address 10.1.1.1 24
[Huawei]router id 10.1.1.1
[Huawei]ospf 1
[Huawei-ospf]area 0
[Huawei-ospf-1-area-0.0.0.0]network 10.0.0.4 0.0.0.3
[Huawei-ospf-1-area-0.0.0.0]network 202.112.1.1 0.0.0.255
静态引入
[Huawei-ospf]import-route static
[Huawei]dhcp enable
[Huawei]ip pool 1
[Huawei-ip-pool-1]network 192.168.4.0 mask 24
[Huawei-ip-pool-1]gateway-list 192.168.4.1
[Huawei-ip-pool-1]dns-list 8.8.8.8
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]dhcp select global
[Huawei]ip route-static 0.0.0.0 0.0.0.0 202.112.1.2
R4
[Huawei]int e0/0/0
[Huawei-Ethernet0/0/0]ip add 202.112.1.2 24
[R4-GigabitEthernet0/0/0]q
[R4]ip route-static 0.0.0.0 0 192.168.1.1
(6)LSW2上配置DHCP中继
[Huawei]vlan batch 20 40 70
[Huawei]ospf 1 router-id 10.4.4.4
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 192.168.4.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 10.0.0.12 0.0.0.3
[Huawei]int g0/0/3
[Huawei-GigabitEthernet0/0/3]port link-type trunk
[Huawei-GigabitEthernet0/0/3]port trunk allow-pass vlan 20 40
[Huawei]int Eth-Trunk 1
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]eth-trunk 1
[Huawei]int g0/0/2
[Huawei-GigabitEthernet0/0/2]eth-trunk 1
[Huawei]int Eth-Trunk 1
[Huawei-Eth-Trunk1]port link-type trunk
[Huawei-Eth-Trunk1]port trunk allow-pass vlan all
[Huawei]int Vlanif 70
[Huawei-Vlanif70]ip address 10.0.0.14 30
[Huawei]int Vlanif 40
[Huawei-Vlanif40]ip address 192.168.4.1 24
[Huawei]int Vlanif 20
[Huawei-Vlanif40]ip address 192.168.2.2 24
开启DHCP功能:
[Huawei]dhcp enable
[Huawei]int Vlanif 40
[Huawei-Vlanif40]dhcp select relay
[Huawei-Vlanif40]dhcp relay server-ip 10.0.0.5
最终配置结果:
PC之间都可以互相ping通
Vlan40内PC由DHCP动态分配IP地址.
主要配置结果:
截了一部分路由表和配置 LSW1 LSW3 LSW4 LSW5 R2 R3 LSW1 R2
R4 LSW4 PC之间ping PC1
DHCP获取信息
1.vlanif与路由器连接,修改接口的pvid与vlanif一致。
2.ospf后接的网段子网掩码是反转的
3.对路由重分发有了更深认识
4.对DHCP server配置有了更深了解