怎么使用ip命令配置ip,ip地址配置命令

首页 > 实用技巧 > 作者:YD1662023-05-07 19:05:06

实验的目的:

掌握路由器命名、配置IP、测试IP连通性、查看设备配置方法、抓包方法。

实验内容:

路由器基本配置,使A、B两个部门互通。

实验拓扑:

怎么使用ip命令配置ip,ip地址配置命令(1)

拓扑图

实验编址:

PC1 IP:10.0.1.1 netmask:255.255.255.0 getway:10.0.1.254

PC2 IP:10.0.2.1 netmask:255.255.255.0 getway:10.0.1.254

R1 IP: 10.0.1.254/10.0.2.254 netmask:255.255.255.0

实验配置:

<Huawei>system-view #进入系统视图

[Huawei]sysname R1 #设置路由器名称

[R1]int GigabitEthernet 0/0/0 #进入接口g0//0/0下

[R1-GigabitEthernet0/0/0]ip add 10.0.1.254 255.255.255.0

#在g0//0/0接口下添加IP

[R1-GigabitEthernet0/0/0]display ip interface brief

#查看接口与IP相关信息,华为物理接口默认处于开启状态。

*down: administratively down

^down: standby

(l): loopback

(s): spoofing

The number of interface that is UP in Physical is 3

The number of interface that is DOWN in Physical is 1

The number of interface that is UP in Protocol is 2

The number of interface that is DOWN in Protocol is 2

Interface IP Address/Mask Physical Protocol

GigabitEthernet0/0/0 10.0.1.254/24 up up

GigabitEthernet0/0/1 unassigned up down

GigabitEthernet0/0/2 unassigned down down

NULL0 unassigned up up(s)

同理配置GigabitEthernet0/0/1

<R1>system-view

[R1]int g0/0/1

[R1-GigabitEthernet0/0/1]ip add 10.0.2.254 24

[R1-GigabitEthernet0/0/1]display ip interface brief

<R1>display ip routing-table #配置完成后查看路由表相关信息

<R1>display ip routing-table

Route Flags: R - relay, D - download to fib

------------------------------------------------------------------------------

Routing Tables: Public

Destinations : 10 Routes : 10

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24 Direct 0 0 D 10.0.1.254 GigabitEthernet

0/0/0

10.0.1.254/32 Direct 0 0 D 127.0.0.1 GigabitEthernet

0/0/0

10.0.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet

0/0/0

10.0.2.0/24 Direct 0 0 D 10.0.2.254 GigabitEthernet

0/0/1

10.0.2.254/32 Direct 0 0 D 127.0.0.1 GigabitEthernet

0/0/1

10.0.2.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet

0/0/1

127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0

127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

<R1>save 保存

怎么使用ip命令配置ip,ip地址配置命令(2)

抓包

根据个人需求设置抓取某一个端口的数据流量包。

栏目热文

文档排行

本站推荐

Copyright © 2018 - 2021 www.yd166.com., All Rights Reserved.