Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

Connect an IP camera via wired ethernet to an ethernet USB adapter to a Raspberry Pi

Connect the camera to the ethernet USB adapter via a CROSSOVER cable (or via an ethernet switch).

Install DHCP server:

sudo apt install isc-dhcp-server

Edit config:

sudo nano /etc/default/isc-dhcp-server

and bind only to the USB adapter ethernet interface (e.g. "enp1s0"):


Edit config, let's assign to

sudo nano /etc/dhcp/dhcpd.conf
subnet netmask {
  option routers;
  option subnet-mask    ;
  option domain-name-servers;
  option domain-name "";

host ipcam {
  hardware ethernet 00:75:5e:93:7c:92;

Allow through firewall:

sudo ufw allow bootps

Bring up:

sudo ip addr add dev enp1s0
sudo ip link set enp1s0 up
sudo systemctl restart isc-dhcp-server

N.B. remove any other addresses from enp1s0 that might be present.

Add route:

sudo ip route add dev enp1s0


sudo nano /var/lib/dhcp/dhclient.leases
sudo tcpdump -v -n -i enp1s0 port bootps or port bootpc
tail -f /var/log/syslog

Check assigned IP address from logs and visit camera configurtion panel in the web browser. Grab RTSP port number (554), disable wifi, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment