I'm trying to implement the ptp/ip library for my DLSR (nikon d7200). Because my camera uses the (limited) wifi-direct mode, I need a device in between my development computer and the camera, so that I still can use the internet in my main computer.
I ended up using a Raspberry PI 4 as the middle point between the DSLR (nikon d7200) and the computer. The PI is in the same network through ethernet as my development computer, and I'm using the PI's wi-fi to connect to the cameras own wi-fi hotspot.
The problem is that both the camera's and my router's ip is
192.168.1.1. I have already tried to change the IP of my router, but it broke too much other stuff. Thus, changing neither of the actual IPs is not feasible, as my DSLR doesn't allow it either.
I need to find a way to differentiate the two interfaces' same ip addresses.
My question is: Is there a way to alias the IPs of
wlan0 to another range, so that the gateway for
eth0 is the default (
192.168.1.1), and the gateway for
wlan0 is something else. Keep in mind that the packets of
wlan0 still need to end up going to the 192.168.1.1 (my DSLR)
I have already tried to bind a random IP address to the the gateway of
wlan0 on the PI:
sudo ip route add 10.0.0.0/24 via 192.168.1.1 dev wlan0, but couldn't get it to work (
packet_filtered when trying with ping)
I have also tried to use the
socket library in Python3, mainly the
SO_BINDTODEVICE option. However, the socket libary for Python3 is a little too low level for my taste.
I cannot change the
metric parameter for any of the interfaces, as this would break my VNC connection.
If someone out there can nudge me in the right direction, I will be grateful!