IP地址(类似于身份证编码):同一网络中用于标识唯一主机的地址,由网络位和主机位组成。
子网掩码(类似于身份证编码的构成规定:如第一、二位,表示省份的代码;第三、四位,所在城市的代码等):用来区分网络位和主机位的一个功能地址。
网络地址:(类似于身份证的区域编码北京11天津 12等):用来标识一组网络的地址。
广播地址(类似于某个地区的身份证管理机构用来接收上级部门发出的信息):用来接收广播消息的地址。
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r1
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip address 125.41.12.31 21
Apr 26 2022 09:23:22-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]dis th
[V200R003C00]
#
interface GigabitEthernet0/0/0
ip address 125.41.12.31 255.255.248.0
#
return
十进制 | 二进制 | 说明 | |
子网掩码 | 255.255.248.0 | 11111111.11111111.11111000.00000000 | 1的部分为网络位 0的部分为主机位 |
IP地址 | 125.41.12.31 | 01111101.00101001.00001100.00011111 | 根据子网掩码得出 蓝色网络位 黄色主机位 |
网络地址 | 125.41.8.0 | 01111101.00101001.00001000.00000000 | 把IP地址的主机位变为全0得到网络地址 |
广播地址 | 125.41.15.255 | 01111101.00101001.00001111.11111111 | 把IP地址的主机位变为全1得到广播地址 |
可用IP地址范围 | 125.41.8.0——125.41.15.255 | 01111101.00101001.00001000.00000000——01111101.00101001.00001111.11111111 | 网络地址与广播地址之间不包括本身 |
<r1>dis ip routing-table //显示路由表信息就可以看到IP地址,网络地址和广播地址
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 7 Routes : 7
Destination/Mask Proto Pre Cost Flags NextHop Interface
125.41.8.0/21 Direct 0 0 D 125.41.12.31 GigabitEthernet0/0/0
125.41.12.31/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
125.41.15.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0