I have a Windows Container running, but it doesn't have outbound excess My dockerfile has base image
FROM microsoft/aspnet:3.5-windowsservercore-10.0.14393.1715
//Setting IIS for my application
Expose 443
I create container using below line
docker run -it -d --name myWebApp --cpus=2 --memory=2000m --hostname=doc --domainname=otxlab.net -p 443:443 imagename
My Container's ipconfig looks like this
>ipconfig /all
Windows IP Configuration
Host Name . . . . . . . . . . . . : doc.otxlab.net
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
Ethernet adapter Ethernet 2:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft Hyper-V Network Adapter #2
Physical Address. . . . . . . . . : 00-15-5D-0E-68-2B
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::a8d2:e3d5:656a:f19e%5(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.178.134(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . : 192.168.176.1
DHCPv6 IAID . . . . . . . . . . . : 83891549
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-26-C9-D1-FD-00-15-5D-0E-68-2B
DNS Servers . . . . . . . . . . . : 192.168.176.1
10.194.17.21
10.194.17.22
NetBIOS over Tcpip. . . . . . . . : Disabled
With above config, though I'm able to ping internal servers but not able to ping google.com My application log errors out with below error The remote name could not be resolved: 'accounts.accesscontrol.windows.net'
Setting my hostmachine's dns server as primary and secondary
Get-NetAdapter
Set-DnsClientServerAddress -InterfaceIndex 5 -ServerAddresses 10.194.17.21,10.194.17.22
Now I'm able to ping google.com and also resolve above name with nslookup But still my application logs errors out with below error The opeartion has timed out
Not really sure, why the application is still not able to get response from external domain. I have also checked my IIS logs
2020-08-19 08:14:31 192.168.178.134 GET /WebPartPage/??? - 443 - 192.168.176.1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/84.0.4147.125+Safari/537.36 https://doc.otxlab.net/WebPartPage/BrowseWebPartPage.aspx?SPHostUrl=https%3A%2F%2F%2Esharepoint%2Ecom%2Fsites%2Ftest%2F&SPClientTag=0&SPProductNumber=16%2E0%2E20405%2E12005&wpId=g%5Fee83e176%5F1759%5F4e80%5Fb2dc%5F4d53a7aa2d85&SenderId=DD6D40620 404 0 2 46
I see the default gateway is used to make request. Is this the issue ? How can I change it ? I have tried setting it to my host machine (VM default gateway) but with no luck. Should I be creating a new network for windows Container ?