I want to make traffic to a specified LPD/LPR print server (specified via URL) pass through the authentication and routing, gateway, etc for the WiFi interface, and keep all other incoming/outgoing outgoing traffic through the Ethernet interface.
Edit 1: I'm also happy to have a scripted solution that retrieves IP addresses and updates the routing table, if it's not possible to set this up in terms of the server's URL.
Configuration:
- Ubuntu 22.04.1 LTS system
- Ethernet and Wifi network interfaces are both present and correctly configured. They each dial out to different limited subsets of the Internet, but with different authentication, rules for port blocking, firewalls, address translation, etc.
- I can access a specific LPD/LPR print server via its URL over the WiFi interface. But, activating Ethernet as well as WiFi changes the routes and makes this server inaccessible.
Prior research
- I tried to follow this answer to route some traffic through the WiFi interface specifically. Copying the commands naïvely gave a
SIOCADDRT: No such processerror from theroutecommand. - I tried to follow this answer to work around it, and ended up with a routing table that ... looks plausible, but I still couldn't reach the server via the WiFi route if Ethernet was also enabled.
traceroutenever really completes. I think it needs authentication information for the print server to make it all the way to the final IP and port. But, I can see that the initial gateway for WiFi-only configuration is the one I want; In the Wifi+Ethernet enabled configuration this changes to the wrong gateway despite my attempted modifications to the routing table.
Other Stack Exchange Questions
- This related question does not apply, since it is about setting up a home printer with physical access to a router/switch.
- This question seems to have a vaguely related goal but seems to be for Windows, and has no answers.
- Stack Exchange thinks this question is related, but I'm pretty sure it's about briding or somesuch.
- This one is explicitly Windows.
- This question is in the same ballpark, and I have no doubt that "change the routing tables" is the correct approach, but I don't know exactly how to achieve what I want in Ubuntu/Debian Linux.
- Ditto here—routing tables are an answer but how?
- This answer may be applicable but I do not yet understand it.
Happy to provide more redacted details of configuration as requested if it will help. Flipping the network interface in order to print and back again after is fine, but I'm curious if I can get an even smoother solution.