1

In Linux I want to install a HP LaserJet 1320n that needs to be power up and down. It will get a new IP-address every time it's powercycled. How can I install the printer on a Linux machine and not be dependent on that the printer gets the same IP-address every time it's switched on?

  • 4
    Have you considered reserving the IP address for the printer in your DHCP server? in most routers today, there is such an option that will make sure the printer gets the same IP based on its mac address. – Tom Klino Jun 8 '15 at 21:27
  • Tom's answer is by far preferable, but if you are unable to do this for some reason, does your DHCP server and DNS combination allow for dynamic DNS allocation? If so, there'll be a DNS entry for the printer that will follow it from IP address to IP address. – Smiling Dragon Jun 9 '15 at 3:49
  • That's the best idea @TomKlino! It turned out that it was very simple even in my 4G-modem/router. @SmilingDragon thanks for your nice idea anyway! – PetaspeedBeaver Jun 10 '15 at 18:49
0

Even in my Huawei CPE B593 home router/4G-modem there was the opportunity to bundle a device to a MAC-address as suggested by Tom Klino above. I think this is the best solution if it's possible.

First find out the IP of the printer:

user@PetaspeedBeaver:~$ lpstat -a
laserjet1320_killeberg accepting requests since ons 10 jun 2015 20:22:56
user@PetaspeedBeaver:~$ lpstat -v laserjet1320_killeberg
device for laserjet1320_killeberg: hp:/net/hp_LaserJet_1320_series?ip=100.100.1.5

Then find out the MAC-address of the printer. On the HP LaserJet 1320n it's not listed on the machine, but you can access it through telnet if you connect to the printer:

root@PetaspeedBeaver:~# telnet 100.100.1.5
Trying 100.100.1.5...
Connected to 100.100.1.5.
Escape character is '^]'.
HP JetDirect
Password is not set

Please type "menu" for the MENU system, 
or "?" for help, or "/" for current settings.
> menu
   ===JetDirect Telnet Configuration===
   HP JetDirect       : J7958A
   Firmware Version   : V.28.05
   Manufacturing ID   : 25014523F02501
   Hardware Address   : 00:13:21:C3:E1:4F
   System Up Time     : 0:05:09

MAC-address listed as "Hardware Address" above.

Then just bundle it to the IP in the router. In the Huawei CPE B593 it's under LAN-DHCP Settings. Click apply to restart the DHPC-server and it should work!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.