Eu tenho um domínio local (vamos chamá-lo de mycorp.local
).
Em um computador, configurei uma conexão VPN para um domínio remoto (suponhamos que o sufixo DNS seja remote.local
).
Assim que estabeleço a conexão remota, a autenticação de domínio local é interrompida para trabalhos. Por exemplo, tento me conectar a um servidor SQL usando autenticação integrada, mas ele falha com esse erro:
Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. (Microsoft SQL Server, Error: 18452)
Se eu desconectar a VPN, posso fazer login novamente no SQL.
Ambos os domínios não têm relação de confiança.
Meu primeiro palpite é que a conexão VPN tem precedência sobre o DNS local. É por isso que eu segui essa resposta: Conexão VPN faz com que o DNS use o erro Servidor DNS . Basicamente, a resposta permitia alterar a ordem da interface para tentar a resolução do DNS.
Suponho que a configuração do DNS esteja correta, porque posso executar ping em computadores SQL e de anúncios quando a VPN é estabelecida.
Existe algum parâmetro / configuração a ser aplicado para garantir que a autenticação ocorra no domínio correto?
Se puder ajudar, aqui estão alguns detalhes sobre minha configuração:
- 2 placas de rede
- 1 que pode acessar a rede AD
- 1 com acesso à internet
- sub-rede local: 192.168.10.0/24. Métrica definida para 1
- sub-rede do segundo cartão: 192.168.66.0/24. Métrica definida para 100
- Sub-rede da conexão da VPN: 172.16.0.0/16. Métrica definida para 9999
Em todos os casos, ping sql
, ping sql.mycorp.local
, ping ad
e ping ad.mycorp.local
estão resolvendo corretamente os endereços IP (claro que com alguns ipconfig /flushdns
para ter certeza).
A saída completa de ipconfig /all
é:
Windows IP Configuration
Host Name . . . . . . . . . . . . : mycomputer
Primary Dns Suffix . . . . . . . : mycorp.local
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : mycorp.local
remote.local
Ethernet adapter Local:
Connection-specific DNS Suffix . : mycorp.local
Description . . . . . . . . . . . : Microsoft Hyper-V Network Adapter #3
Physical Address. . . . . . . . . : 00-15-5D-14-20-0D
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::d117:9048:ce1c:1422%16(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.10.30(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
DHCPv6 IAID . . . . . . . . . . . : 385881437
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-19-8B-E5-3D-00-15-5D-14-20-0F
DNS Servers . . . . . . . . . . . : fe80::80ce:dc9d:37c5:39f3%16
192.168.10.10
NetBIOS over Tcpip. . . . . . . . : Enabled
Ethernet adapter RJ45:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft Hyper-V Network Adapter #2
Physical Address. . . . . . . . . : 00-15-5D-14-20-0E
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IPv6 Address. . . . . . . . . . . : 2a01:e35:8a84:7240:c0eb:c8d1:9c3f:8fc0(Preferred)
Link-local IPv6 Address . . . . . : fe80::c0eb:c8d1:9c3f:8fc0%13(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.66.11(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Lease Obtained. . . . . . . . . . : lundi 12 août 2013 13:06:28
Lease Expires . . . . . . . . . . : jeudi 22 août 2013 13:06:28
Default Gateway . . . . . . . . . : fe80::207:cbff:fe3c:5b7f%13
192.168.66.254
DHCP Server . . . . . . . . . . . : 192.168.66.254
DNS Servers . . . . . . . . . . . : fe80::80ce:dc9d:37c5:39f3%13
192.168.10.10
NetBIOS over Tcpip. . . . . . . . : Enabled
Ethernet adapter Wifi:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft Hyper-V Network Adapter
Physical Address. . . . . . . . . : 00-15-5D-14-20-0F
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::c551:f03f:7557:9b17%11(Preferred)
Autoconfiguration IPv4 Address. . : 169.254.155.23(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . :
DHCPv6 IAID . . . . . . . . . . . : 234886493
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-19-8B-E5-3D-00-15-5D-14-20-0F
DNS Servers . . . . . . . . . . . : fe80::80ce:dc9d:37c5:39f3%11
192.168.10.10
NetBIOS over Tcpip. . . . . . . . : Enabled
PPP adapter VPN remote:
Connection-specific DNS Suffix . : remote.local
Description . . . . . . . . . . . : VPN remote
Physical Address. . . . . . . . . :
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
IPv4 Address. . . . . . . . . . . : 172.16.110.243(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.255
Default Gateway . . . . . . . . . :
DNS Servers . . . . . . . . . . . : 172.16.100.47
172.16.100.43
Primary WINS Server . . . . . . . : 172.16.100.47
Secondary WINS Server . . . . . . : 172.16.122.100
NetBIOS over Tcpip. . . . . . . . : Enabled
Tunnel adapter isatap.{DEFE2CAC-D001-4E79-A33F-AD95A8106CA8}:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft ISATAP Adapter
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter Local Area Connection* 9:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter isatap.{2AE1C64F-102F-48B4-A60A-AA28461A96EF}:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft ISATAP Adapter #2
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter isatap.remote.local:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . : remote.local
Description . . . . . . . . . . . : Microsoft ISATAP Adapter #3
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter isatap.mycorp.local:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . : mycorp.local
Description . . . . . . . . . . . : Microsoft ISATAP Adapter #4
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
A saída completa do comando route print
é:
===========================================================================
Interface List
16...00 15 5d 14 20 0d ......Microsoft Hyper-V Network Adapter #3
13...00 15 5d 14 20 0e ......Microsoft Hyper-V Network Adapter #2
11...00 15 5d 14 20 0f ......Microsoft Hyper-V Network Adapter
28...........................VPN Remote
1...........................Software Loopback Interface 1
12...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
14...00 00 00 00 00 00 00 e0 Teredo Tunneling Pseudo-Interface
15...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #2
17...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #3
18...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #4
===========================================================================
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.66.254 192.168.66.11 100
77.245.100.10 255.255.255.255 192.168.66.254 192.168.66.11 101
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
169.254.0.0 255.255.0.0 On-link 169.254.155.23 261
169.254.155.23 255.255.255.255 On-link 169.254.155.23 261
169.254.255.255 255.255.255.255 On-link 169.254.155.23 261
172.16.0.0 255.255.0.0 172.16.110.240 172.16.110.243 10000
172.16.110.243 255.255.255.255 On-link 172.16.110.243 10255
192.168.10.0 255.255.255.0 On-link 192.168.10.30 257
192.168.10.30 255.255.255.255 On-link 192.168.10.30 257
192.168.10.255 255.255.255.255 On-link 192.168.10.30 257
192.168.66.0 255.255.255.0 On-link 192.168.66.11 356
192.168.66.11 255.255.255.255 On-link 192.168.66.11 356
192.168.66.255 255.255.255.255 On-link 192.168.66.11 356
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 192.168.10.30 257
224.0.0.0 240.0.0.0 On-link 192.168.66.11 356
224.0.0.0 240.0.0.0 On-link 169.254.155.23 261
224.0.0.0 240.0.0.0 On-link 172.16.110.243 10255
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 192.168.10.30 257
255.255.255.255 255.255.255.255 On-link 192.168.66.11 356
255.255.255.255 255.255.255.255 On-link 169.254.155.23 261
255.255.255.255 255.255.255.255 On-link 172.16.110.243 10255
===========================================================================
Persistent Routes:
None
IPv6 Route Table
===========================================================================
Active Routes:
If Metric Network Destination Gateway
13 356 ::/0 fe80::207:cbff:fe3c:5b7f
1 306 ::1/128 On-link
13 108 2a01:e35:8a84:7240::/64 On-link
13 356 2a01:e35:8a84:7240:c0eb:c8d1:9c3f:8fc0/128
On-link
16 257 fe80::/64 On-link
13 356 fe80::/64 On-link
11 261 fe80::/64 On-link
13 356 fe80::c0eb:c8d1:9c3f:8fc0/128
On-link
11 261 fe80::c551:f03f:7557:9b17/128
On-link
16 257 fe80::d117:9048:ce1c:1422/128
On-link
1 306 ff00::/8 On-link
16 257 ff00::/8 On-link
13 356 ff00::/8 On-link
11 261 ff00::/8 On-link
===========================================================================
Persistent Routes:
None
[Editar] Para acompanhar o comentário do TheCleaner.
klist purge
klist
saídas:
Current LogonId is 0:0x6a9a3
Deleting all tickets:
Ticket(s) purged!
Current LogonId is 0:0x6a9a3
Cached Tickets: (0)
Inicie o programa e tente conectar-se (Sql Management Studio). Sucesso, então:
sqlcmd -S sql -E -Q "select getdate()"
klist
saídas:
Current LogonId is 0:0x6a9a3
Cached Tickets: (0)
Estabeleceu a conexão VPN e, em seguida:
sqlcmd -S sql -E -Q "select getdate()"
klist
saídas:
Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : Login failed. The login is from an untrusted domain and cannot be used with Windows authentication..
LogonId atual é 0: 0x6a9a3
Cached Tickets: (1)
#0> Client: steve @ mycorp.LOCAL
Server: krbtgt/mycorp.LOCAL @ mycorp.LOCAL
KerbTicket Encryption Type: RSADSI RC4-HMAC(NT)
Ticket Flags 0x40e00000 -> forwardable renewable initial pre_authent
Start Time: 8/12/2013 15:14:22 (local)
End Time: 8/13/2013 1:14:22 (local)
Renew Time: 8/19/2013 15:14:22 (local)
Session Key Type: RSADSI RC4-HMAC(NT)
[Editar 2] Depois de ativar o registro de eventos do kerberos , eu obter um log de eventos específico:
A Kerberos Error Message was received:
on logon session
Client Time:
Server Time: 19:18:33.0000 8/12/2013 Z
Error Code: 0x7 KDC_ERR_S_PRINCIPAL_UNKNOWN
Extended Error:
Client Realm:
Client Name:
Server Realm: remote.LOCAL
Server Name: MSSQLSvc/sql:1433
Target Name: MSSQLSvc/sql:[email protected]
Error Text:
File: 9
Line: f09
Error Data is in record data.
Se você olhar para o reino, verá que o reino não é mycorp.local
, mas remote.local
.