1.拓扑信息:
2.实验要求:
(设备名称按照拓扑标识修改,注意区分大小写)
1
、
ISP
路由器仅配置
IP
地址
2
、
test-1
和
test-2
仅作为代替终端设备进行测试使用,路由采用静态路由
3
、
R1/R2
之间使用
O
SP
F
做到内网全通,单区域,
O
SP
F
使用一条命令进行宣告(直接宣告
192.168.1.0
网段);
r
ou
ter-I
D 分别为1.1.1.1
和
2.2.2.2
;
O
SP
F
进程为
1
4
、
PC1-PC4
使用
DH
CP
获取地址,地址池名称使用
1
,
2
5
、
PC1
不能访问
PC5
,
ac
l
编号为
3000
6
、
R2
出口只拥有一个公网
IP
7
、
test-1
设备可以登录内网
telnet
服务器,
test-2
不行;
ac
l
编号为
3000
8
、
telnet
服务器的账号密码为
huaw
e
i
/123456
9
、内网用户可以正常访问
ISP
(边界做默认路由)
10
、公网设备的路由表不能有私网的路由,使用
n
a
t
(
ac
l
编号为
2000
)
11
、内网设备的路由表不能有公网的路由,边界下发默认路由
12
、
VLAN
及
IP
规划查看附件材料(所有
tr
u
n
k
链路按照最少
VLAN
透传原则放通)
3.附件材料:
![](https://img-blog.csdnimg.cn/direct/32f80ed88f004998b040988544fd256c.png)
4.实验步骤
1.给两个交换机分别配置VLAN并配置永不超时
LW1
The device is running!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys LW1
[LW1]user-interface console 0
[LW1-ui-console0]idle-timeout 0 0
[LW1-ui-console0]quit
[LW1]int g0/0/2
[LW1-GigabitEthernet0/0/2]quit
[LW1]vlan batch 2 3 4
[LW1-GigabitEthernet0/0/2]port link-type access
[LW1-GigabitEthernet0/0/2]port default vlan 2
[LW1-GigabitEthernet0/0/2]int g0/0/3
[LW1-GigabitEthernet0/0/3]port link-type access
[LW1-GigabitEthernet0/0/3]port default vlan 3
[LW1-GigabitEthernet0/0/3]int g0/0/4
[LW1-GigabitEthernet0/0/4]port link-type access
[LW1-GigabitEthernet0/0/4]port default vlan 4
[LW1-GigabitEthernet0/0/4]int g0/0/1
[LW1-GigabitEthernet0/0/1]port link-type trunk
[LW1-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 3 4
[LW1-GigabitEthernet0/0/1]quit
LW2
The device is running!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys LW2
[LW2]user-interface console 0
[LW2-ui-console0]idle-timeout 0 0
[LW2-ui-console0]quit
[LW2]vlan batch 20 30
[LW2]int g0/0/2
[LW2-GigabitEthernet0/0/2]port link-type access
[LW2-GigabitEthernet0/0/2]port default vlan 20
[LW2-GigabitEthernet0/0/2]int g0/0/3
[LW2-GigabitEthernet0/0/3]port link-type access
[LW2-GigabitEthernet0/0/3]port default vlan 3
[LW2-GigabitEthernet0/0/3]int g0/0/1
[LW2-GigabitEthernet0/0/1]port link-type trunk
[LW2-GigabitEthernet0/0/1]port trunk allow-pass vlan
[LW2-GigabitEthernet0/0/1]port trunk allow-pass vlan 20 30
[LW2-GigabitEthernet0/0/1]quit
R1
The device is running!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r1
[r1]user-interface console 0
[r1-ui-console0]i
[r1-ui-console0]idle-timeout 0 0
[r1-ui-console0]int g0/0/0.1
[r1-GigabitEthernet0/0/0.1]dot1q termination vid 2
[r1-GigabitEthernet0/0/0.1]ip address 192.168.1.30 27
[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.62 27
[r1-GigabitEthernet0/0/0.2]int g0/0/0.3
[r1-GigabitEthernet0/0/0.3]dot1q termination vid 4
[r1-GigabitEthernet0/0/0.3]ip address 192.168.1.158 27
[r1-GigabitEthernet0/0/0.3]quit
[r1]dhcp enable
[r1]ip pool 1
[r1-ip-pool-1]network 192.168.1.0 mask 27
[r1-ip-pool-1]gateway-list 192.168.1.30
[r1-ip-pool-1]dns-list 8.8.8.8
[r1-ip-pool-1]quit
[r1]ip pool 2
[r1-ip-pool-2]network 192.168.1.32 mask 27
[r1-ip-pool-2]gateway-list 192.168.1.62
[r1-ip-pool-2]dns-list 8.8.8.8
[r1-ip-pool-2]quit
[r1]int g0/0/0.1
[r1-GigabitEthernet0/0/0.1]dhcp select global
[r1-GigabitEthernet0/0/0.1]arp broadcast enable
[r1-GigabitEthernet0/0/0.1]int g0/0/0.2
[r1-GigabitEthernet0/0/0.2]dhcp select global
[r1-GigabitEthernet0/0/0.2]arp broadcast enable
[r1-GigabitEthernet0/0/0.2]int g0/0/0.3
[r1-GigabitEthernet0/0/0.3]arp broadcast enable
[r1-GigabitEthernet0/0/0.3]quit
R2
The device is running!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R2
[R2]user-interface console 0
[R2-ui-console0]idle-timeout 0 0
[R2-ui-console0]int g0/0/0.1
[R2-GigabitEthernet0/0/0.1]dot1q termination vid 20
[R2-GigabitEthernet0/0/0.1]ip address 192.168.1.94 27
[R2-GigabitEthernet0/0/0.1]int g0/0/0.2
[R2-GigabitEthernet0/0/0.2]dot1q termination vid 30
[R2-GigabitEthernet0/0/0.2]ip address 192.168.1.126 27
[R2-GigabitEthernet0/0/0.2]quit
[R2]dhcp enable
[R2]ip pool 1
[R2-ip-pool-1]network 192.168.1.64 mask 27
[R2-ip-pool-1]gateway-list 192.168.1.94
[R2-ip-pool-1]dns-list 8.8.8.8
[R2-ip-pool-1]quit
[R2]ip pool 2
[R2-ip-pool-2]network 192.168.1.96 mask 27
[R2-ip-pool-2]gateway-list 192.168.1.126
[R2-ip-pool-2]dns-list 8.8.8.8
[R2-ip-pool-2]quit
[R2]int g0/0/0.1
[R2-GigabitEthernet0/0/0.1]dhcp select global
[R2-GigabitEthernet0/0/0.1]arp broadcast enable
[R2-GigabitEthernet0/0/0.1]int g0/0/0.2
[R2-GigabitEthernet0/0/0.2]dhcp select global
[R2-GigabitEthernet0/0/0.2]arp broadcast enable
[R2-GigabitEthernet0/0/0.2]quit
2.配置路由器接口IP地址
R1
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ip address 192.168.1.161 30
[r1-GigabitEthernet0/0/1]quit
R2
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.1.162 30
[R2-GigabitEthernet0/0/1]int g0/0/2
[R2-GigabitEthernet0/0/2]ip address 202.1.1.1 30
[R2-GigabitEthernet0/0/2]quit
test-1
The device is running!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys test-1
[test-1]user-interface console 0
[test-1-ui-console0]idle-timeout 0 0
[test-1-ui-console0]quit
[test-1]int g0/0/0
[test-1-GigabitEthernet0/0/0]ip address 203.1.1.1 24
[test-1-GigabitEthernet0/0/0]quit
test-2
The device is running!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname test-2
[test-2]user-interface console 0
[test-2-ui-console0]i
[test-2-ui-console0]idle-timeout 0 0
[test-2-ui-console0]quit
[test-2]int g0/0/0
[test-2-GigabitEthernet0/0/0]ip address 203.1.1.2 24
[test-2-GigabitEthernet0/0/0]quit
Telnet Server
The device is running!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys Telnet Server
[Telnet Server]user-interface console 0
[Telnet Server-ui-console0]idle-timeout 0 0
[Telnet Server-ui-console0]quit
[Telnet Server]int g0/0/0
[Telnet Server-GigabitEthernet0/0/0]ip address 192.168.1.129 27
[Telnet Server-GigabitEthernet0/0/0]quit
ISP
The device is running!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys ISP
[ISP]user-interface console 0
[ISP-ui-console0]idle-timeout 0 0
[ISP-ui-console0]quit
[ISP]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip address 202.1.1.2 30
[ISP-GigabitEthernet0/0/0]int g0/0/1
[ISP-GigabitEthernet0/0/1]ip address 203.1.1.254 24
[ISP-GigabitEthernet0/0/1]quit
配置ospf实现R1与R2之间的通信
R1
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]quit
[r1-ospf-1]quit
R2
[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.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]quit
3.在Telnet服务器上配置缺省路由实现通信
[Telnet Server]ip route-static 0.0.0.0 0 192.168.1.158
4.PC5手动配置IP
5.给R2配置缺省指向外网,并进行OSPF,配置NAT技术
[R2]ip route-static 0.0.0.0 0 202.1.1.2
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]default-route-advertise
[R2-ospf-1]quit
[R2]acl 2000
[R2-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[R2-acl-basic-2000]quit
[R2]int g0/0/2
[R2-GigabitEthernet0/0/2]nat outbound 2000
[R2-GigabitEthernet0/0/2]quit
6.test-1和test-2配置静态路由
test-1
[test-1]ip route-static 202.1.1.0 30 203.1.1.254
test-2
[test-2]ip route-static 202.1.1.0 30 203.1.1.254
6.配置acl使PC1不能访问PC5
R2
[r1]acl 3000
[r1-acl-adv-3000]rule deny icmp source 192.168.1.29 0 destination 203.1.1.100 0
[r1-acl-adv-3000]quit
[r1]int g0/0/2
[r1-GigabitEthernet0/0/2]quit
[r1]int g0/0/0.1
[r1-GigabitEthernet0/0/0.1]traffic-filter inbound acl 3000
[r1-GigabitEthernet0/0/0.1]quit
7.在telnet server路由器进行配置telnet
[Telnet Server]aaa
[Telnet Server-aaa]local-user huawei password cipher 123456 privilege level 15
[Telnet Server-aaa]local-user huawei service-type telnet
[Telnet Server-aaa]quit
[Telnet Server]user-interface vty 0 4
[Telnet Server-ui-vty0-4]authentication-mode aaa
[Telnet Server-ui-vty0-4]quit
配置端口映射
R2
[R2-GigabitEthernet0/0/2]nat server protocol tcp global current-interface 23 ins
ide 192.168.1.129 23
Are you sure to continue?[Y/N]:y
[R2-GigabitEthernet0/0/2]quit
配置ACL拒绝test-2的包
ISP
[ISP-acl-adv-3000]
[ISP-acl-adv-3000]rule deny tcp source 203.1.1.2 0 destination 202.1.1.1 0 desti
nation-port eq 23
[ISP-acl-adv-3000]quit
[ISP]int g0/0/1
[ISP-GigabitEthernet0/0/1]traffic-filter inbound acl 3000
[ISP-GigabitEthernet0/0/1]quit