192.168.1.0 24
3个大的网线 所以需要移动2位,变为26 位
192.168.1.0 26分成多个骨干网段
192.168.1.0 30
192.168.1.4 30
192.168.1.8 30等,总共有16个
客户端网段:
192.168.1.64 26 两个路由器子接口 192.168.1.64 27 192.168.1.96 27
192.168.1.128 26 两个路由器子接口 192.168.1.128 27 192.168.1.160 27
192.168.1.192 26
第一个交换机:(创建vlan,建立trunk干道 )
sys
[Huawei]sysname sw1
[sw1]vlan batch 2 to 3
[sw1]port-group group-member Ethernet 0/0/2 to Ethernet 0/0/3
[sw1-port-group]port link-type access
[sw1-Ethernet0/0/2]port link-type access
[sw1-Ethernet0/0/3]port link-type access
[sw1-port-group]port default vlan 2
[sw1-Ethernet0/0/2]port default vlan 2
[sw1-Ethernet0/0/3]port default vlan 2
[sw1]port-group group-member Ethernet 0/0/4
[sw1-port-group]port link-type access
[sw1-Ethernet0/0/4]port link-type access
[sw1-port-group]port default vlan 3
[sw1-Ethernet0/0/4]port default vlan 3
[sw1]int g0/0/1
[sw1-GigabitEthernet0/0/1]port link-type trunk
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan all
第一个路由器:(创建子接口,创建dhcp池塘,ospf协议划分三个区域(沉默、汇总、加密))
sys
[Huawei]sysname r1
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ip address 192.168.1.1 30
[r1]int g0/0/0.1
[r1-GigabitEthernet0/0/0.1]dot1q termination vid 2
[r1-GigabitEthernet0/0/0.1]ip address 192.168.1.65 27
[r1-GigabitEthernet0/0/0.1]arp broadcast enable
[r1-GigabitEthernet0/0/0.1]int g0/0/0.2
[r1-GigabitEthernet0/0/0.2]dot1q termination vid 3
[r1-GigabitEthernet0/0/0.2]ip address 192.168.1.97 27
[r1-GigabitEthernet0/0/0.2]arp broadcast enable
[r1]dhcp enable
[r1]ip pool xiaobai
[r1-ip-pool-xiaobai]network 192.168.1.64 mask 27
[r1-ip-pool-xiaobai]gateway-list 192.168.1.65
[r1-ip-pool-xiaobai]dns-list 114.114.114.114
[r1]ip pool xiaohei
[r1-ip-pool-xiaohei]network 192.168.1.96 mask 27
[r1-ip-pool-xiaohei]gateway-list 192.168.1.97
[r1-ip-pool-xiaohei]dns-list 114.114.114.114
[r1]int g0/0/0.1
[r1-GigabitEthernet0/0/0.1]dhcp select global
[r1-GigabitEthernet0/0/0.1]int g0/0/0.2
[r1-GigabitEthernet0/0/0.2]dhcp select global
[r1]ospf 1 router-id 1.1.1.14
[r1-ospf-1]area 1
[r1-ospf-1-area-0.0.0.1]network 192.168.1.65 0.0.0.0
[r1-ospf-1-area-0.0.0.1]network 192.168.1.97 0.0.0.0
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.1 0.0.0.0
[r1]osp
[r1]ospf 1
[r1-ospf-1-area-0.0.0.1]abr-summary 192.168.1.64 255.255.255.192
[r1]ospf 1
[r1-ospf-1]silent-interface g0/0/0.1
[r1-ospf-1]silent-interface g0/0/0.2
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher 123456
[r1]aaa(telnet远程登录)
[r1-aaa]local-user xiaoming privilege level 15 password cipher 123456
[r1-aaa]local-user xiaoming service-type telnet
[r1]user-interface vty 0 4
[r1-ui-vty0-4]authentication-mode aaa
[r1]acl 3000
[r1-acl-adv-3000]rule deny tcp source 192.168.1.92 0 destination 192.168.1.1 0 destination-port eq 23
[r1-acl-adv-3000]rule deny tcp source 192.168.1.92 0 destination 192.168.1.65 0 destination eq 23
[r1-acl-adv-3000]rule deny tcp source 192.168.1.92 0 destination 192.168.1.97 0 destination eq 23
[r1]int g0/0/0.1
[r1-GigabitEthernet0/0/0.1]traffic-filter inbound acl 3000
[r1]ip route-static 192.168.1.64 26 NULL 0(防环)
将PC1换成路由器:(自动获取ip地址)
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]dhcp enable
[Huawei-GigabitEthernet0/0/0]ip address dhcp-alloc
[Huawei]display ip interface brief
GigabitEthernet0/0/0 192.168.1.92/27 up up
[Huawei]sysname pc1
telnet 192.168.1.1
Xiaoming
123456
第二个交换机:(创建vlan,建立trunk干道 )
sys
[Huawei]sysname sw2
[sw2]vlan batch 2 to 3
[sw2]int e0/0/2
[sw2-Ethernet0/0/2]port link-type access
[sw2-Ethernet0/0/2]port default vlan 2
[sw2]int e0/0/3
[sw2-Ethernet0/0/3]port link-type access
[sw2-Ethernet0/0/3]port default vlan 3
[sw2]int g0/0/1
[sw2-GigabitEthernet0/0/1]port link-type trunk
[sw2-GigabitEthernet0/0/1]port trunk allow-pass vlan all
第二个路由器:创建子接口,创建dhcp池塘,ospf协议划分三个区域(沉默、汇总、加密))
sys
[Huawei]sysname r2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
[r2]int g0/0/2
[r2-GigabitEthernet0/0/2]ip address 12.1.1.1 24
[r2]int g0/0/1.1
[r2-GigabitEthernet0/0/1.1]dot1q termination vid 2
[r2-GigabitEthernet0/0/1.1]ip address 192.168.1.129 27
[r2-GigabitEthernet0/0/1.1]arp broadcast enable
[r2-GigabitEthernet0/0/1.1]int g0/0/1.2
[r2-GigabitEthernet0/0/1.2]dot1q termination vid 3
[r2-GigabitEthernet0/0/1.2]ip address 192.168.1.161 27
[r2-GigabitEthernet0/0/1.2]arp broadcast enable
[r2]dhcp enable
[r2]ip pool xiaobai
[r2-ip-pool-xiaobai]network 192.168.1.128 mask 27
[r2-ip-pool-xiaobai]gateway-list 192.168.1.129
[r2-ip-pool-xiaobai]dns-list 114.114.114.114
[r2-ip-pool-xiaobai]ip pool xiaohei
[r2-ip-pool-xiaohei]network 192.168.1.160 mask 27
[r2-ip-pool-xiaohei]gateway-list 192.168.1.161
[r2-ip-pool-xiaohei]dns-list 114.114.114.114
[r2]int g0/0/1.1
[r2-GigabitEthernet0/0/1.1]dhcp select global
[r2-GigabitEthernet0/0/1.1]int g0/0/1.2
[r2-GigabitEthernet0/0/1.2]dhcp select global
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 192.168.1.2 0.0.0.0
[r2-ospf-1]area 2
[r2-ospf-1-area-0.0.0.2]network 192.168.1.129 0.0.0.0
[r2-ospf-1-area-0.0.0.2]network 192.168.1.161 0.0.0.0
[r2]ospf 1
[r2-ospf-1]area 2
[r2-ospf-1-area-0.0.0.2]abr-summary 192.168.1.128 255.255.255.192
[r2-ospf-1]silent-interface g0/0/1.1
[r2-ospf-1]silent-interface g0/0/1.2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
[r2]ospf 1
[r2-ospf-1]default-route-advertise always
[r2]ip route-static 0.0.0.0 0 12.1.1.2(下一跳)
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r2]int g0/0/2
[r2-GigabitEthernet0/0/2]nat outbound 2000
[r2-GigabitEthernet0/0/2]nat server protocol tcp global current-interface 80 inside 192.168.1.100 80
Are you sure to continue?[Y/N]:y
[r2]int g0/0/2
[r2-GigabitEthernet0/0/2]nat server protocol tcp global current-interface 23 inside 192.168.1.1 23
[r2]ip route-static 192.168.1.128 26 NULL 0(防环)
第三个路由器:
sys
[Huawei]sysname r3
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip address 12.1.1.2 24
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip address 1.1.1.1 24
telnet 12.1.1.1
Xiaoming
123456
3
Client1: http://12.1.1.1:80能够得到
Sever2