2019-10-29

OSPF+DHCP等综合实验

实验拓扑图

实验拓扑图

开始实验

1.首先对AR4进行一些基础配置
进入系统视图并更改设备名称

system-view
syaname (AR4)

配置R4的IP

interface GigabitEthernet 0/0/1
ip address 192.168.4.254 24
interface GigabitEthernet 0/0/0
ip address 192.168.14.4 24

2.配置AR1
进入系统视图并更改设备名称

system-view
syaname (AR1)

配置LoopBack

interface LoopBack 0
ip address 1.1.1.1 32

配置物理接口

interface GigabitEthernet 0/0/2
ip address 192.168.14.1 24
interface GigabitEthernet 2/0/0
ip address 192.168.16.1 24
interface GigabitEthernet 0/0/0
ip address 192.168.12.1 24
interface GigabitEthernet 0/0/1
ip address 192.168.13.1 24

3.配置AR6(telnet 服务器)
进入系统视图并更改设备名称

system-view
syaname (AR6)

配置LoopBack

interface LoopBack 0
ip address 6.6.6.6 32

配置物理接口

interface GigabitEthernet 0/0/0
ip address 192.168.16.6 24

4.配置AR2
进入系统视图并更改设备名称

system-view
syaname (AR2)

配置LoopBack

interface LoopBack 0
ip address 2.2.2.2 32

配置跟AR1、AR3连接的物理接口

interface GigabitEthernet 0/0/0
ip address 192.168.12.2 24
interface GigabitEthernet 0/0/1
ip address 192.168.23.2 24

5.配置AR3
进入系统视图并更改设备名称

system-view
syaname (AR3)

配置LoopBack

interface LoopBack 0
ip address 3.3.3.3 32

配置跟AR2、AR1、AR5连接的物理接口

interface GigabitEthernet 0/0/0
ip address 192.168.23.3 24
interface GigabitEthernet 0/0/1
ip address 192.168.13.3 24
interface GigabitEthernet 0/0/2
ip address 192.168.35.3 24

6.配置AR5
进入系统视图并更改设备名称

system-view
syaname (AR5)

配置LoopBack

interface LoopBack 0
ip address 5.5.5.5 32

配置跟AR3、LSW1-1连接的物理接口

interface GigabitEthernet 0/0/0
ip address 192.168.35.5 24
interface GigabitEthernet 0/0/1.10
ip address 192.168.10.254 24
interface GigabitEthernet 0/0/1.20
ip address 192.168.20.254 24

7.在AR4下配置DHCP全局地址池
进入系统视图

dhcp enable

创建ip pool并取名

ip pool pool4

设置network、gateway、dns、lesse day、excluded

network 192.168.4.0 mask 24
gateway-list 192.168.4.254
dns-list 8.8.8.8
lease day 2
excluded-ip-address 192.168.4.100 192.168.4.199
undo in en

在GigabitEthernet 0/0/1下配置全局地址池

interface GigabitEthernet 0/0/1
dhcp select global

打开PC1、PC2,找到基础配置栏,选上DHCP然后应用,分别命令行栏输入ipconfig,查看是否配置成功

8.在AR5下配置DHCP全局地址池
进入系统视图

dhcp enable
undo in en

进入 interface GigabitEthernet 0/0/1.10 配置接口地址池

dhcp select interface
dhcp server dns-list 8.8.8.8
dhcp server lease day 2

进入 interface GigabitEthernet 0/0/1.20 配置接口地址池

dhcp select interface
dhcp server dns-list 8.8.8.8
dhcp server lease day 2

配置 interface GigabitEthernet 0/0/1.20 单臂路由

dotlq termination vid 20
arp broadcast enable

配置 interface GigabitEthernet 0/0/1.10 单臂路由

dotlq termination vid 10
arp broadcast enable

9.配置交换机LSW1-1的单臂路由
创建vlan

system-view
syaname (LSW1-1)
vlan
undo in en
vlan batch 10 20

配置端口

interface Ethernet 0/0/2
port link-type access
port default vlan 10
interface Ethernet 0/0/3
port link-type access
port default vlan 20
interface Ethernet 0/0/4
port link-type access
port default vlan 20

配置trunk端口

interface Ethernet 0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20

配置完后,打开3台主机的DHCP,找到基础配置栏,选上DHCP应用,分别命令行栏输入ipconfig,查看是否配置成功
10.AR4静态路由的配置
配置route-static

ip route-static 0.0.0.0 0.0.0.0 192.168.14.1

11.配置AR1的OSPF

ospf router-id 1.1.1.1
area 0
network
network 192.168.16.0 0.0.0.255
network 192.168.14.0 0.0.0.255
network 192.168.12.0 0.0.0.255
network 192.168.13.0 0.0.0.255
network 1.1.1.1 0.0.0.0
undo in en

12.配置AR6(telnet 服务器)的OSPF

ospf router-id 6.6.6.6
area 0
network 192.168.16.0 0.0.0.255
network 6.6.6.6 0.0.0.0

13.配置AR2的OSPF

ospf router-id 6.6.6.6
area 0
network 192.168.12.0 0.0.0.255
network 192.168.23.0 0.0.0.255
network 2.2.2.2 0.0.0.0

14.配置AR3的OSPF

undo  in en
ospf router-id 3.3.3.3
area 0
network 192.168.13.0 0.0.0.255
network 192.168.23.0 0.0.0.255
network 192.168.35.0 0.0.0.255
network 3.3.3.3 0.0.0.0

15.配置AR5的OSPF

ospf router-id 5.5.5.5
area 0
network 192.168.35.0 0.0.0.255
network 192.168.10.0 0.0.0.255
network 192.168.20.0 0.0.0.255
network 5.5.5.5 0.0.0.0

查看AR5是否学到AR1的地址

display ip routing-table
display ip routing-table protocol ospf

在APR4上ping一下,看网络是否连通

ping ...

16.配置AR1静态路由

ip route-static 192.168.4.0 24 192.168.14.4

进入ospf视图下

import-route static

进入AR5

display ip routing-table protocol ospf

17.在AR3、AR5上配置OSPF接口认证

interface GigabitEthernet 0/0/2
ospf authentication-mode md5 1 huawei
interface GigabitEthernet 0/0/0
ospf authentication-mode md5 1 huawei

18.配置AR6(telnet 服务器)的相关配置

ping 5.5.5.5
user-interface vty 0 4
authentication-mode password
set authentication-mode password cipher huawei
user privilege level 2

退出系统视图进行telnet测试

telnet 5.5.5.5

你可能感兴趣的:(2019-10-29)