Background:
I have to set up some Epson receipt printers. The printers are configured by pointing your web browser to http://192.168.192.168/ and submitting a form. I wrote a Python script that can simulate a form POST, and the printers can now be configured without using the web interface. The one drawback is that my computer must be on the 192.168.192.0/24 network.
Question:
Is it possible to create a virtual network interface in Python that my script can use without me having to manually change the computers network settings?
You have a problem that python cannot solve.
It sounds like your network has been administratively compartmentalized for some reason. If there is a firewall or a bastion-host machine connected to both administrative domains, you might be able to leverage Port Address Translation to keep this server on one network and poll the other.
If 192.168.192.0 has not been intentionally segmented for administrative / security reasons; it could be a simple oversight by your LAN administrator. In that case, they can add 192.168.192.0 to the corporate routing table.
The final option would be some kind of VPN connectivity between the administrative domains… again, discuss with your network admins.
EDIT
Since you need a linux ethernet alias, the easiest way is with
iproute2in linux… useip addr add 192.168.192.1/24 dev eth0as rootNow plug your printer into your ethernet switch… you should be able to ping 192.168.192.168… to remove:
ip addr del 192.168.192.1/24 dev eth0(as root)