一.靜態域名解析
實驗目的:
交換機利用靜態域名解析功能,實現通過主機名 host.com 訪問IP 地址為10.1.1.2 的主機Host。
配置主機名www.chengwang.com對應的IP 地址為192.168.2.177。
[H3C]ip host www.chengwang.com 192.168.2.177
[H3C]int vlan 1.
[H3C-Vlan-interface1]ip add 192.168.2.1 24
執行ping www.chengwang.com 命令,Switch 通過靜態域名解析可以解析到www.chengwang.com對應的IP 地址為192.168.2.177。
[H3C]ping www.chengwang.com
PING www.chengwang.com (192.168.2.177): 56 data bytes, press CTRL_C to break
Reply from 192.168.2.177: bytes=56 Sequence=1 ttl=63 time=15 ms
Reply from 192.168.2.177: bytes=56 Sequence=2 ttl=63 time=3 ms
Reply from 192.168.2.177: bytes=56 Sequence=3 ttl=63 time=2 ms
Reply from 192.168.2.177: bytes=56 Sequence=4 ttl=63 time=3 ms
Reply from 192.168.2.177: bytes=56 Sequence=5 ttl=63 time=3 ms
--- www.chengwang.com ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 2/5/15 ms
二.動態域名解析
實驗目的:
交換機作為 DNS 客戶端,使用動態域名解析功能,實現通過域名(gao)訪問IP 地址為192.168.1.177 的主機。域名服務器的 IP 地址是2.1.1.2/16,配置域名后綴為com。
實驗拓撲
配置DNS服務器
配置交換機
[Switch]dns resolve //啟動動態域名解析功能。
[Switch]dns server 192.168.1.254 //配置域名服務器的IP 地址為192.168.1.254。
[Switch]dns domain chengwang.com //配置域名后綴chengwang.com。
在設備上執行ping gao 的命令,可以ping 通主機,且對應的目的地址為192.168.1.177
[Switch] ping gao
Trying DNS server (192.168.1.254)
PING host.com (192.168.1.177): 56 data bytes, press CTRL_C to break
Reply from 192.168.1.177: bytes=56 Sequence=1 ttl=125 time=4 ms
Reply from 192.168.1.177: bytes=56 Sequence=2 ttl=125 time=4 ms
Reply from 192.168.1.177: bytes=56 Sequence=3 ttl=125 time=4 ms
Reply from 192.168.1.177: bytes=56 Sequence=4 ttl=125 time=4 ms
Reply from 192.168.1.177: bytes=56 Sequence=5 ttl=125 time=5 ms
--- host.com ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 4/4/5 ms
三.DNS代理
ARP實驗
[H3C]arp static 192.168.1.177 20CF-3000-476A //配置ARP 映射表中的靜態ARP 表項
[H3C]mac-address ?
blackhole 黑洞表項,不能被老化,可以添加/刪除,可以寫入配置文件
dynamic 動態表項,能夠增加/刪除,交換機復位丟失
multicast 多播表項,不能被老化,可以添加/刪除,可以寫入配置文件
security 安全MAC 表項,不能被老化,可以添加/刪除,可以寫入配置文件
static 靜態表項,不能被老化,可以添加/刪除,可以寫入配置文件
timer 配置定時器
[H3C]mac-address blackhole 20CF-3000-476A interface e1/0/10 vlan 1 //配置mac黑洞,不管在那個接口上設置了mac黑洞,就算是主機換了端口后,依然生效!!
[H3C]arp timer aging ? //置動態ARP 表項的老化時間[高1]
INTEGER<1-1440> ARP定時值(分鍾)
[H3C]arp timer aging
缺省情況下,動態ARP 表項的老化時間為20 分鍾。