Hi, I've been searching around the forum and other resources but can't find out how to connect to an ethernet Arduino on my home network from the internet. Does anyone know of a guide or recommended procedure? I want to connect to the board('s) and interact using text. I've been looking at zoomkat's example http://arduino.cc/forum/index.php/topic,100051.0.html which I loaded with my Arduino & network settings but my browser timed out. Do I need to use router port forwarding & if so which option? Is the sketch gateway value the same as my router default gateway? How would I distinguish between various ethernet &/or WiFi/ethernet Arduinos on my LAN? Thanks in advance for any info - Alex.
You need a bit more than just port forwarding
-
In order to be able to connect tou your home network you need to know what it's public IP address is. Your Internet service provider likely a has assigned a public, dynamic IP address via DHCP to you, so each time your router disconnects and then reconnects you may have a different IP address. So yo can either talk to your ISP and ask for a static IP address, which is likely to cost you more money, or you can remedy that by registering at dyndns.com, or no-ip.org. Then you have a name associated with your dynamic 4-byte IP address, for example myArduino.no- ip.org, that you can use instead of the 4-byte IP address.
-
Likely your home network assigns a private, dynamic IP address also via DHCP to the devices in your home, including your Ethernet, or WiFi enabled Arduino. It depends a little on your routers abilities, but, yes, you could port- forward port 80 (http) to your Arduino borards IP. Some routers can do this per device name so regardless of what private, dynamic IP address they have assigend to the device it goes to the right device. Or you can reserve a static IP address in your Router for your Arduino.
Did you notice that zoomkat's example uses port 84?
http://xx.xx.xx.xx:84
Many ISPs block port 80 requests to residential clients. Try port 8088 instead.
Zoomcat's sketch worked real nicely on the LAN! I also hope to get it to work through the internet.
Thanks to all that have posted on this subject!
Can you set your DMZ on your router to the private ip of the Arduino? That will perform a destination nat from your public ip to the Arduino private ip.
Or you can assign a public ip to the Arduino.
edit: Whoa! Is that a Karma value on the user info above the number of posts? That will be handy helping new people determine who can help them. Miktrotik uses that very effectively. I'm SurferTim there also.
http://forum.mikrotik.com/
edit: Whoa! Is that a Karma value on the user info above the number of posts? That will be handy helping new people determine who can help them. Miktrotik uses that very effectively. I'm SurferTim there also.
Oooo, a karama thing. Some kind of rating thing was turned on when this new forum was setup and quickly turned into a most fabulous turd swirl.
I swirled SurferTim's, and Zoomcat's turds with my touch pad on the laptop!!!
One Karma for each!
Thanks for karma, cyclegadget!
@zoomkat: The "turd swirl" should go good with those salted peanuts!
Thanks for the info folks. I have followed Headrooms' suggestion of having a name associated with my dynamic 4-byte IP address.
Telnetting from inside my LAN to the Ethernet-Arduino still works fine. Wireshark shows two Address Resolution Protocol frames:
- my computer broadcasts a 'Who has (Ethernet_Arduino IP address), tell (my computer IP address)' ARP request.
- my Ethernet-Arduino addresses my computer with 'its IP address is at its MAC address' ARP reply.
Then TCP & TELNET protocol frames continue in what I expect is normal behavior (I'm happy with it).
Telnetting into my LAN to the Ethernet-Arduino seems to get stuck in the ARP protocol sequence. This time it's my router
(I think) that is issuing the 'Who is' ARP request. It seems to be cycling through typical IP address'. When it hits my
computers address my computer responds with an ARP reply (as the Ethernet-Arduino did when addresses from within my LAN).
So, the Ethernet_Arduino issues ARP protocol replies when addressed directly from my LAN but not automatically when addressed
from the internet? Any ideas? Alex.
P.S. My router (BT Homehub 2) gave this DMZ warning...
DMZ - assign the public IP address of a connection to a device on your home network.
You can use this feature when you're troubleshooting a device or application.
However, in most cases, we recommend that you use Port Forwarding instead.
Important: using this feature can have a serious impact on your Hub and the security of your network.
The device that you've assigned to the internet service will no longer be protected by your Hub's firewall.
We recommend that you only use this feature as a temporary measure while troubleshooting.
Hosts with statically assigned IP addresses cannot be placed into DMZ mode.
Hi, I'm getting a little curious about the lack of interest in this subject? Is there a better way to access a domestic LAN based Ethernet-Arduino from the internet?
I'm currently stuck on an Address Resolution Protocol (ARP) issue.
-
I can Telnet to the Ethernet-Arduino from the same LAN. In this case an Ethernet-Arduino ARP reply includes correct IP & MAC address.
-
Telnetting into my LAN from the internet causes my router to make an ARP request 'broadcast' to the Ethernet-Arduino IP address'. The 'broadcast' does not include the Ethernet-Arduino MAC address, only the IP address. The Ethernet-Arduino fails to respond with the APR reply.
Thoughts? Thanks - Alex.
In my case it is not lack of interest, just lack of that router. I use Mikrotik routers and have no problems routing to my Arduino, but they are a bit more difficult to set up than a residential router.
In other routers I have used, the DMZ applies to only one internal ip address, and would not disable security for the entire subnet. Mikrotik routers must be set manually for a DMZ-like operation using port forwarding.
edit: If you are worried about the security warning when you activate the DMZ, I wouldn't. That is aimed at a computer that may have other ports open, like telnet and ssh. That would present a security problem if the computer did not have a good firewall.
However, the Arduino has the best firewall I have ever seen. It does not respond to any port but the one you assign. It is like a backwards firewall. All is blocked, except what you have set in the Arduino server.
In the typical home router you would use a dynamic ip address service like no-ip.com and set port fowarding in the router for incomming traffic. Your router's user manual mentions the below, so you might check that out.
port forwarding settings in Hub Manager
Yes, I'm using no-ip.com (thanks Headroom), the dynamic update client works well allowing me to SSH into my home PC & generate Telnet originated ARP requests from the internet. Though I'm not sure of the distinction I have tried both Telnet port forwarding options in my BT Homehub2 - 'Telnet Server' & 'Virtual Terminal Server (TELNET)' .
My router requires nonstatic IP address' for DMZ but allways makes the Ethernet-Arduino IP address static after portforwarding - not sure if I can override that?
Is DCHP going to offer any advantages? Using DCHP the Ethernet-Arduino reported a different MAC address 'de:ad be:ef fe:ed', so I guess thats configurable?
My ISP in my area of the UK is due an imminent broadband speed increase in a service called 'BT Infinity'. This requires a different router - just wondering if any UK users know if a new IPS/'commercial alternative' router would solve my problem? Thanks again folks - Alex.