How to automatically get IP address for running jupyter notebook in local network

23 Views Asked by At

I have two computers connected to same router using Lan cable. One computer is running jupyter notebook, and I want to access it from another computer.

So i use this command

jupyter notebook --port 8888 --ip=192.168.1.12

How did I find this IP address? I typed this command

nmap -sn 192.168.1.0/24

And it printed a bunch of IP addresses. I tried them one by one, and If it is not free, i got this error

OSError: [Errno 99] Cannot assign requested address

Is there any way to automate this process? Finding correct IP Address?

If I restart PC or router, i need to find the new IP again. Is theree any way to keep a fixed IP?

0

There are 0 best solutions below