Ip config
-
Hi,
i want to access DUET from external network to my home… for this i need DUET ever has the same IP, and cant acomplish
My WIFI setup in [c]config.g[/c] is:
[[language]] ; Network M550 PTLM Duet Wifi ; Set machine name M552 S1 ; Enable network M587 S"Dlink-869L.2,4" P"a1b2c3d4" I"192.168.1.50" ; Configure access point and IP addresses. You can delete this line once connected M586 P0 S1 ; Enable HTTP M586 P1 S1 ; Enable FTP M586 P2 S1 ; Enable Telnet
but after restart… the IP of DUET is 192.168.1.109.... and after some restart it will change.
I wish, the IP of DUET ever the same, for acomplish external local ip access, open ports in router
What i have to do? -
do an IP Address reservation in your router to tie the wanted IP Address to the Mac address of your Duet.
how to do this depends on your router hardware?
-
Agreed, setting a DHCP reservation from the router is probably the best way to do this. It is the way I handle my IP address for my Duet WiFi.
-
i have select a IP for Duet, outside the space DHPC server asign IP, for other PC in the LAN, this works…
-
Assuming you are up to date with a recent (1.19 or later) firmware; specify the IP address in your M552 command like this:
[[language]] M552 P192.168.1.50
And comment out the M587 line.. The wifi firmware 'digests' this line and remembers the network without it needing to be specified each time.
See the gcode wiki entries here: https://duet3d.com/wiki/G-code#M552:_Set_IP_address.2C_enable.2Fdisable_network_interface
This is working well for me, my address stays static and I have not had to reconfigure my router; I chose an address outside the DHCP range of course.
-
I notice you want to expose the web interface through your router.
Look at M586: https://duet3d.com/wiki/G-code#M586:_Configure_network_protocolsI would STRONGLY advise against enabling ftp or telnet this way.
Sorry for Mr Shouty, but there are now botnets out there actively looking for IOT devices on random ports. I used to run ssh on a random port and this worked well for years, but now I've gone back to the default (with fail2ban in place) since the random port stuff wasn't really working anymore and I got fed up re-configuring things every few days.
-
You may also want to edit your posted gcode and delete your network password as it is in there.
-
thanks for recommendation… but
I see unlikely, that someone from this forum, come to my house to steal my wifi.
Unlikely, does not mean impossible
-
For remote access to a Duet, I advise setting up a VPN (Virtual Private Network). The better WiFi routers have this facility built in.
-
No worries; so long as it all stays within your local network+wifi then you are good
I was thinking you wanted to open external access from the whole Internet; but I see what you mean now, double sorry for Mr Shouty -
For remote access to a Duet, I advise setting up a VPN (Virtual Private Network). The better WiFi routers have this facility built in.
If you have a server (eg octoprint, or a media box) at home that you can ssh into then another good (and quick) solution is a SSH tunnel,
- Use [c]-L 80:ip.of.duet.wifi:6000[/c] with your ssh client command; then go to [c]http://localhost:6000/[/c] in the browser.
- The SSH tunnel keeps the connection to the Duet alive quite well even if you are on a remote network with all sorts of random packet loss and disconnects.
- The [c]-L[/c] option is extremely powerful when used with the right options; it can substitute for many functions of a VPN if you get your client config right.
(this is an old sysadmin trick, by the way.. ssh is a pretty robust protocol when used on networks that are having issues; it works quite hard to re-establish it's own connection; while seamlessly keeping the terminal connections alive at the endpoints, if something is wrong you tend to see timeouts rather than disconnects.)