HCNA配置接口IP地址

1、拓扑图

2、R1配置

The device is running!

<Huawei>sys
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysn
[Huawei]sysname r1
[r1]int
[r1]interface ?
  Bridge-if         Bridge-if interface
  Dialer            Dialer interface
  Eth-Trunk         Ethernet-Trunk interface
  GigabitEthernet   GigabitEthernet interface
  Ima-group         ATM-IMA interface
  LoopBack          LoopBack interface
  MFR               MFR interface
  Mp-group          Mp-group interface
  NULL              NULL interface
  Tunnel            Tunnel interface
  Virtual-Ethernet  Virtual-Ethernet interface
  Virtual-Template  Virtual-Template interface
  Vlanif            Vlan interface
  Wlan-Ess          Wlan-Ess interface
[r1]dis int
[r1]dis interface
GigabitEthernet0/0/0 current state : UP
Line protocol current state : DOWN
Description:HUAWEI, AR Series, GigabitEthernet0/0/0 Interface
Route Port,The Maximum Transmit Unit is 1500
Internet protocol processing : disabled
IP Sending Frames‘ Format is PKTFMT_ETHNT_2, Hardware address is 00e0-fc3e-555d
Last physical up time   : 2017-12-07 21:23:07 UTC-08:00
Last physical down time : 2017-12-07 21:22:55 UTC-08:00
Current system time: 2017-12-07 21:26:36-08:00
Port Mode: COMMON COPPER
Speed : 1000,  Loopback: NONE
Duplex: FULL,  Negotiation: ENABLE
Mdi   : AUTO
Last 300 seconds input rate 0 bits/sec, 0 packets/sec
Last 300 seconds output rate 0 bits/sec, 0 packets/sec
Input peak rate 0 bits/sec,Record time: -
Output peak rate 0 bits/sec,Record time: -

Input:  0 packets, 0 bytes
  Unicast:                  0,  Multicast:                   0
  Broadcast:                0,  Jumbo:                       0
  Discard:                  0,  Total Error:                 0

  CRC:                      0,  Giants:                      0

[r1]int
[r1]interface g
[r1]interface GigabitEthernet 0
[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ip add
[r1-GigabitEthernet0/0/0]ip address 12.1.1.1 255.255.255.0
[r1-GigabitEthernet0/0/0]
Dec  7 2017 21:27:20-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r1-GigabitEthernet0/0/0]q
[r1]dis ip int br
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 2
The number of interface that is DOWN in Physical is 2
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              12.1.1.1/24          up         up
GigabitEthernet0/0/1              unassigned           down       down
GigabitEthernet0/0/2              unassigned           down       down
NULL0                             unassigned           up         up(s)
[r1]

3、R2配置

 Configuration console exit, please press any key to log on

<Huawei>sys
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysn
[Huawei]sysname R2
[R2]int g
[R2]int GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip add 12.1.1.2  24
Error: The address already exists.
[R2-GigabitEthernet0/0/0]ip add 12.1.1.3 24
[R2-GigabitEthernet0/0/0]q
[R2]dis ip int
[R2]dis ip interface br
[R2]dis ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 2
The number of interface that is DOWN in Physical is 2
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              12.1.1.3/24          up         up
GigabitEthernet0/0/1              unassigned           down       down
GigabitEthernet0/0/2              unassigned           down       down
NULL0                             unassigned           up         up(s)
[R2]

4、测试

 Configuration console time out, please press any key to log on

<r1>ping  12.1.1.2
  PING 12.1.1.2: 56  data bytes, press CTRL_C to break
    Request time out
    Request time out
    Request time out

  --- 12.1.1.2 ping statistics ---
    3 packet(s) transmitted
    0 packet(s) received
    100.00% packet loss

<r1>
<r1>ping 12.1.1.3
  PING 12.1.1.3: 56  data bytes, press CTRL_C to break
    Reply from 12.1.1.3: bytes=56 Sequence=1 ttl=255 time=160 ms
    Reply from 12.1.1.3: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 12.1.1.3: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 12.1.1.3: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 12.1.1.3: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 12.1.1.3 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/48/160 ms

<r1>ping 12.1.1.3 ?
  ip-forwarding  Specify the request packet forward by IP
  <cr>           Please press ENTER to execute command
<r1>ping 12.1.1.3
  PING 12.1.1.3: 56  data bytes, press CTRL_C to break
    Reply from 12.1.1.3: bytes=56 Sequence=1 ttl=255 time=30 ms
    Reply from 12.1.1.3: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 12.1.1.3: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 12.1.1.3: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 12.1.1.3: bytes=56 Sequence=5 ttl=255 time=30 ms

  --- 12.1.1.3 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/26/30 ms

<r1>
[R2]ping  12.1.1.1
  PING 12.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 12.1.1.1: bytes=56 Sequence=1 ttl=255 time=30 ms
    Reply from 12.1.1.1: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 12.1.1.1: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 12.1.1.1: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 12.1.1.1: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 12.1.1.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/24/30 ms
时间: 2024-10-30 08:37:24

HCNA配置接口IP地址的相关文章

路由器配置接口IP地址和网关的配置

网拓扑图 实验步骤 路由器的配置 配置网关 两个网络的通信验证 实验总结:实验的重点就是路由器的配置,通过路由器配置两个异构网络的网关,然后就是保存路由器的配置,最后一定要配个各个主机的网关,否则无法ping通 路由器配置接口IP地址和网关的配置

配置接口IP地址并通过静态路由、默认路由配置实现全网互通!

配置接口IP地址并通过静态路由.默认路由配置实现全网互通1.对Router-R1/R3进行默认路由配置,R2为静态路由配置 2.配置好PC机的IP地址,子网掩码,网关之后,开始配置路由R1/2/3/的IP地址. <Huawei> //用户视图<Huawei>system-view //在用户视图下输入命令行进入系统视图[R1]interface GigabitEthernet 0/0/1 //进图接口视图[R1-GigabitEthernet0/0/1]ip address 192

配置接口IP地址并通过静态路由实现全网互通

1.为两台PC机配置好各自的IP地址,子网掩码,网关 2.配置好PC机之后,开始配置路由器的IP地址 3.开始配置静态路由 和下一跳 [R1]ip route-static 192.168.3.0 255.255.255.0 192.168.2.2[R1]ip route-static 192.168.4.0 255.255.255.0 192.168.2.2 [R2]ip route-static 192.168.1.0 255.255.255.0 192.168.2.1[R2]ip rout

配置接口IP地址并通过默认路由配置实现全网互通。

使用eNSP搭建实验环境,如图-3所示.实现此案例需要按照如下步骤进行1.[R1]ip route-static 0.0.0.0 0.0.0.0 192.168.2.22.[R3]ip route-static 0.0.0.0 0.0.0.0 192.168.3.13.[R2]ip route-static 192.168.1.0 255.255.255.0 192.168.2.14.[R2]ip route-static 192.168.4.0 255.255.255.0 192.168.3.

如何为CentOS 7配置静态IP地址

问题:在CentOS 7上,我想要将我其中一个网络接口从DHCP改为静态IP地址配置,如何才能永久为CentOS或RHEL 7上的网络接口分配静态IP地址? 如果你想要为CentOS 7中的某个网络接口设置静态IP地址,有几种不同的方法,这取决于你是否想要使用网络管理器. 网络管理器(Network Manager)是一个动态网络的控制器与配置系统,它用于当网络设备可用时保持设备和连接开启并激活.默认情况下,CentOS/RHEL 7安装有网络管理器,并处于启用状态. 使用下面的命令来验证网络管

CentOS 7配置静态IP地址

如果你想要为CentOS 7中的某个网络接口设置静态IP地址,有几种不同的方法,这取决于你是否想要使用网络管理器. 网络管理器(Network Manager)是一个动态网络的控制器与配置系统,它用于当网络设备可用时保持设备和连接开启并激活.默认情况下,CentOS/RHEL 7安装有网络管理器,并处于启用状态. 使用下面的命令来验证网络管理器服务的状态: $ systemctl status NetworkManager.service 运行以下命令来检查受网络管理器管理的网络接口: $ nm

linux配置网卡IP地址命令详细介绍及一些常用网络配置命令

linux配置网卡IP地址命令详细介绍及一些常用网络配置命令2010-12-17 0 个评论 收藏 我要投稿 Linux命令行下配置IP地址不像图形界面下那么方 便,完全需要我们手动配置,下面就给大家介绍几种配置的方法: 即时生效(重启后失效): ifconfig eth0 192.168.1.102 netmask 255.255.255.0 //添加IP地址 route add default gw 192.168.1.1 //添加网关 启动生效: vim /etc/sysconfig/ne

[转帖]在 RHEL8 配置静态 IP 地址的不同方法

在 RHEL8 配置静态 IP 地址的不同方法 https://linux.cn/article-11390-1.html nmtui nmcli 命令和修改参数文件的方式. 作者: Pradeep Kumar 译者: LCTT heguangzhi | 2019-09-25 22:28 在 Linux 服务器上工作时,在网卡/以太网卡上分配静态 IP 地址是每个 Linux 工程师的常见任务之一.如果一个人在 Linux 服务器上正确配置了静态地址,那么他/她就可以通过网络远程访问它.在本文中

CentOS7 配置接口IP

CentOS7 配置接口IP Centos7的接口名称不再默认使用eth名称,在接口配置文件目录下查看接口名称: cd /etc/sysconfig/network-scripts/ ifcfg-ens33 ---- 使用vi编辑接口文件,默认的配置为: TYPE=EthernetBOOTPROTO=dhcpDEFROUTE=yesPEERDNS=yesPEERROUTES=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEF