Skip to content

Commit 4c16e5d

Browse files
authored
Update WiFiNatRouter.ino
1 parent dc4e728 commit 4c16e5d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

WiFiNatRouter.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ void setup()
2424
Serial.println("Starting NAT demo");
2525

2626
WiFi.begin(sta_ssid, sta_password);
27-
//WiFi.config(ip, gateway, subnet);
2827

2928
//Wifi connection
3029
while (WiFi.status() != WL_CONNECTED) {
@@ -53,10 +52,13 @@ void setup()
5352
Serial.print("AP IP address: ");
5453
Serial.println(myIP);
5554

55+
// Initialize the NAT feature
5656
ip_napt_init(IP_NAPT_MAX, IP_PORTMAP_MAX);
5757

58+
// Enable NAT on the AP interface
5859
ip_napt_enable_no(1, 1);
5960

61+
// Set the DNS server for clients of the AP to the one we also use for the STA interface
6062
dhcps_set_DNS(WiFi.dnsIP());
6163

6264
}

0 commit comments

Comments
 (0)