0

I have an Ubuntu 18.04.6 home server, connected via wifi (wlp2s0) to the internet. It has ip 192.168.1.13 on the local home network.

I want to connect a wired ethernet camera, that has a fixed ip of 192.168.1.99 when connected to the router. Now, I'd like to connect this camera to the home server via LAN (enp0s25), assign the camera ip 192.168.1.99, and share this camera over the wifi.

The connection works when ethernet is disconnected. When I connect the ethernet cable (between server and camera), though, I think the computer tries to connect to the internet through eth and internet stops working.

Only selecting "Use this connection only for resource on this network" for eth as suggested here does not work.

I followed the instructions here, and it would not work: the server either sees the camera, or is visible through the network, but never both. Then I figured it might be a priority issue and lowered the priority of wlan as suggested here. However it's still not working as I'd like it to.

Any other ideas please? Many thanks for your help.

3
  • You would have to setup the ethernet connection to have a static IP without a default route set on it for it to work.
    – Terrance
    Jun 4, 2022 at 17:23
  • Hi @Terrance, thanks for your comment. I did try this in many different ways, but if I set the eth (enp0s25) to a fixed ip, say 192.168.1.98, it sees the camera but then the server disappears from the local network. If I then lower the priority of the wifi (ifmetric wlp2s0 50), the server reappears on the local network, but the camera stops working. Any ideas?
    – Emos
    Jun 5, 2022 at 8:20
  • You might want to see: ubuntuforums.org/showthread.php?t=2452472 as I am not 100% sure as you have really not given much details about the server you are using if it is a desktop or a laptop. You might be experiencing where you cannot have both on at the same time, or you need to resubnet one of the addresses to a different subnet that could be causing routing issues.
    – Terrance
    Jun 5, 2022 at 14:23

1 Answer 1

1

I've found the answer thanks to Terrance and a million other posts I've read online, including this. The steps are:

  1. Launch Network Connections, e.g. by clicking on the network icon at the upper right and choosing "Edit Connections..."
  2. Choose "Add", select "Ethernet", and choose "Create..."
  3. Type any name, e.g. "Camera"
  4. Under the IPv4 Settings tab, change the Method drop-down to "Manual"
  5. Choose "Add" next to Addresses, and set Address to value on different subnet to your wifi. E.g, if your server is 192.168.1.2, set the ethernet manual ip to 192.168.2.2, and Netmask to 255.255.255.0; leave Gateway blank. The address is for the Ubuntu computer, so it should be different from the camera addresses. The wired ethernet and wifi network should be on separate subnets otherwise you can encounter routing problems.
  6. Leave DNS servers and routes fields empty
  7. Save and close
  8. Set the camera to manual ip as well, on the same subnet mask as the ethernet, e.g. in my example 192.168.2.3
  9. If you need to communicate between the subnets, make sure to uncomment the line:
net.ipv4.ip_forward=1

in /etc/sysctl.conf and then run "sudo sysctl -p" to reload the configuration.

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.