DNS 在 NAPT 实验室设置中不起作用

网络工程 思科 路由器 纳特
2022-02-16 00:10:25

我有一个小型家庭实验室设置。

我可以192.168.2.1从访客无线客户端 ping。我可以从 2600 路由器 ping 谷歌。

#ping google.ca

Translating "google.ca"...domain server (8.8.8.8) [OK]

Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to
172.217.10.99, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 20/23/24 ms

由于某种原因,无线访客客户端无法解析 DNS?客户端从路由器获取 DHCP。

思科 2600 配置。

no network-clock-participate slot 1
no network-clock-participate wic 0
no aaa new-model
ip subnet-zero
ip cef
!
!
ip name-server 8.8.8.8
ip dhcp excluded-address 10.2.0.1 10.2.0.64
ip dhcp excluded-address 10.3.0.1 10.3.0.64
!
ip dhcp pool GUEST_POOL
   network 10.2.0.0 255.255.255.0
   default-router 10.2.0.1
   dns-server 10.1.0.1
   domain-name net.guest
!
ip dhcp pool NET_POOL
   network 10.3.0.0 255.255.255.0
   domain-name net.net
   dns-server 10.3.0.1
   default-router 10.3.0.1
!
!
!
!
 !
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.1
 description MGMT
 encapsulation dot1Q 1 native
 ip address 10.1.0.1 255.255.255.0
 no ip redirects
 ip nat inside
!
interface FastEthernet0/0.2
 encapsulation dot1Q 2
 ip address 10.2.0.1 255.255.255.0
 no ip redirects
 ip nat inside
!
interface FastEthernet0/0.3
 encapsulation dot1Q 3
 ip address 10.3.0.1 255.255.255.0
 no ip redirects
!
interface FastEthernet0/1
 description Outside
 ip address dhcp
 ip nat outside
 duplex auto
 speed auto
!
ip nat inside source list NAT-2-INTERNET interface FastEthernet0/1 overload
no ip http server
ip classless
ip route 0.0.0.0 0.0.0.0 192.168.2.1
!
!
!
ip access-list extended NAT-2-INTERNET
 permit ip 10.2.0.0 0.0.0.255 any
1个回答

您拥有路由器接口作为 DHCP 客户端为其获取的 DNS 服务器,但您没有在路由器上运行 DNS 服务器,无论如何,这确实是个坏主意。

您可以执行以下操作:

ip dhcp pool GUEST_POOL
   network 10.2.0.0 255.255.255.0
   default-router 10.2.0.1
   dns-server 8.8.8.8
   domain-name net.guest
!
ip dhcp pool NET_POOL
   network 10.3.0.0 255.255.255.0
   domain-name net.net
   dns-server 8.8.8.8
   default-router 10.3.0.1
!

这将为您用于路由器的 DNS 服务器的客户端分配相同的 DNS 服务器,您证明该服务器有效,因为您可以从路由器使用它。