哈哈距離上一次更新已經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.實驗拓撲
2. IP地址表
3.配置過程
(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配置有了更深瞭解