dhcp的数据包
dhcp discover dhcp
发现包
dhcp request dhcp
请求包
dhcp offer dhcp
提供包
dhcp ack
。
dhcp
确认包
排除单个地址
[dhcp]ip pool 1
Info: It's successful to create an IP address pool.
[dhcp-ip-pool-1]network 192.168.1.0 mask 255.255.255.0
[dhcp-ip-pool-1]gateway-list 192.168.1.1
[dhcp-ip-pool-1]dns-list 8.8.8.8
[dhcp-ip-pool-1]excluded-ip-address 192.168.1.254 排除单个地址
[dhcp-ip-pool-1]excluded-ip-address 192.168.1.250 192.168.1.254排除段地址
[dhcp-ip-pool-1]static-bind ip-address 192.168.1.33 mac-address 5489-985F-7AC 固定下放ip
地址
调⽤
[dhcp]interface g0/0/0
[dhcp-GigabitEthernet0/0/0]dhcp select global
查看路由表
[r1]display ip routing-table
Route Flags: R - relay, D - download to fib
\------------------------------------------------------------------------------
Routing Tables: Public
• Destinations : 7 Routes : 7
Destination/Mask Proto Pre Cost Flags NextHop Interface
• 12.1.1.0/24 Direct 0 0 D 12.1.1.1 GigabitEthernet
0/0/0
• 12.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
12.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
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
路由表的查表规则
1.
递归查找
2.
最⻓匹配
下⼀跳写法
[r1]ip route-static 23.1.1.0 24 12.1.1.2 建议使⽤在以太⽹环境中
未知⽹段 未知⽹段⼦⽹掩码 下⼀跳ip地址(和我本地直连的对段接⼝的ip地址)
等开销负载均衡
23.1.1.0/24 Static 60 0 RD 12.1.1.2 GigabitEthernet
0/0/0
• Static 60 0 RD 21.1.1.2 GigabitEthernet
0/0/1
浮动静态路由
ip route-static 23.1.1.0 255.255.255.0 21.1.1.2 preference 61
R4的路由表
Routing Tables: Public
Destinations : 21 Routes : 25
Destination/Mask Proto Pre Cost Flags NextHop Interface
13.1.1.0/24 Static 60 0 RD 34.1.1.1 GigabitEthernet
0/0/0
Static 60 0 RD 43.1.1.1 GigabitEthernet
0/0/1
16.1.1.0/24 Static 60 0 RD 34.1.1.1 GigabitEthernet
0/0/0
Static 60 0 RD 43.1.1.1 GigabitEthernet
0/0/1
24.1.1.0/24 Direct 0 0 D 24.1.1.2 GigabitEthernet
0/0/2
24.1.1.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
24.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
34.1.1.0/24 Direct 0 0 D 34.1.1.2 GigabitEthernet
0/0/0
34.1.1.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
34.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
43.1.1.0/24 Direct 0 0 D 43.1.1.2 GigabitEthernet
0/0/1
43.1.1.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
43.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
45.1.1.0/24 Direct 0 0 D 45.1.1.1 Ethernet4/0/0
45.1.1.1/32 Direct 0 0 D 127.0.0.1 Ethernet4/0/0
45.1.1.255/32 Direct 0 0 D 127.0.0.1 Ethernet4/0/0
67.1.1.0/24 Static 60 0 RD 34.1.1.1 GigabitEthernet
0/0/0
Static 60 0 RD 43.1.1.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
172.16.1.0/24 Static 60 0 RD 34.1.1.1 GigabitEthernet
0/0/0
Static 60 0 RD 43.1.1.1 GigabitEthernet
0/0/1
192.168.0.0/22 Static 60 0 RD 45.1.1.2 Ethernet4/0/0
实验结果(部分)
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]ping 172.16.1.5
PING 172.16.1.5: 56 data bytes, press CTRL_C to break
Request time out
Reply from 172.16.1.5: bytes=56 Sequence=2 ttl=127 time=40 ms
Reply from 172.16.1.5: bytes=56 Sequence=3 ttl=127 time=50 ms
Reply from 172.16.1.5: bytes=56 Sequence=4 ttl=127 time=60 ms
Reply from 172.16.1.5: bytes=56 Sequence=5 ttl=127 time=40 ms