Context
Industrial devices like the ModBerry 500 often come with multiple Ethernet interfaces — typically with eth0 set to a static IP (e.g., 192.168.0.101) and eth1 (e.g., 192.168.20.118) configured via DHCP on your local network.
In some cases, you’ll want to ensure that a specific interface — for example, eth1 — is used as the primary route for Internet access. This is especially important if you plan to remotely connect to the device via SSH, using a custom external port (like 2223) forwarded through your router.
The Problem
Even if you configure the IP and gateway on eth1, Linux may still use eth0 as the default route, because it automatically assigns routing priorities (metrics). In our case, eth1 ended up with metric 203 and eth0 with 202 — making eth0 the preferred route. That’s the opposite of what we wanted.
The Solution: Prioritize eth1 via /etc/dhcpcd.conf
If your system is using dhcpcd as its network manager (which is common on ModBerry), you can set the interface priority easily.
1. Open the config file:
sudo nano /etc/dhcpcd.conf
2. Add this at the end:
interface eth1
metric 100
interface eth0
metric 200
This tells the system: “Use eth1 first, because it has a lower metric.”
3. Restart the service:
sudo systemctl restart dhcpcd
4. Check the active routes:
ip route show
You should see something like:
default via 192.168.120.1 dev eth1 metric 100
default via 192.168.0.99 dev eth0 metric 200
Open SSH Access on Port 2223 via Router NAT (e.g., pfSense)
In this setup, we’re accessing the ModBerry remotely by forwarding a custom external port (like 2223) on the router’s public IP to port 22 on the ModBerry’s eth1 IP address.
1. Set up a NAT Port Forwarding rule on your router (e.g., pfSense)
- External port: 2223
- Internal IP: your ModBerry’s eth1 IP (e.g., 192.168.120.118)
- Internal port: 22 (default SSH port)
- Protocol: TCP
This tells your router: “When someone connects to port 2223 on the public IP, forward that to port 22 on the ModBerry’s eth1 interface.”
2. From outside your network, connect using:
ssh -p 2223 user@YOUR_PUBLIC_ROUTER_IP
Replace user with your actual ModBerry username (e.g., root or pi), and YOUR_PUBLIC_ROUTER_IP with the WAN IP of your pfSense router.
Find Out Who’s on Your Network with One Simple Command
/in Uncategorized/by GénesisWant to see all devices connected to your local network? Try this quick Linux command:
What does it do?
sudo
: Runs with superuser privileges (required for network access).arp-scan
: Scans for devices using the ARP protocol.--interface=eno2
: Specifies the network interface (like your Ethernet or Wi-Fi).-l
: Scans the entire local network (same as--localnet
).What will you see?
Great for:
Connecting to a ModBerry 500 via SSH with Dual Ethernet outside the local network
/in Uncategorized/by GénesisContext
Industrial devices like the ModBerry 500 often come with multiple Ethernet interfaces — typically with eth0 set to a static IP (e.g., 192.168.0.101) and eth1 (e.g., 192.168.20.118) configured via DHCP on your local network.
In some cases, you’ll want to ensure that a specific interface — for example, eth1 — is used as the primary route for Internet access. This is especially important if you plan to remotely connect to the device via SSH, using a custom external port (like 2223) forwarded through your router.
The Problem
Even if you configure the IP and gateway on eth1, Linux may still use eth0 as the default route, because it automatically assigns routing priorities (metrics). In our case, eth1 ended up with metric 203 and eth0 with 202 — making eth0 the preferred route. That’s the opposite of what we wanted.
The Solution: Prioritize eth1 via /etc/dhcpcd.conf
If your system is using dhcpcd as its network manager (which is common on ModBerry), you can set the interface priority easily.
1. Open the config file:
2. Add this at the end:
This tells the system: “Use eth1 first, because it has a lower metric.”
3. Restart the service:
4. Check the active routes:
You should see something like:
Open SSH Access on Port 2223 via Router NAT (e.g., pfSense)
In this setup, we’re accessing the ModBerry remotely by forwarding a custom external port (like 2223) on the router’s public IP to port 22 on the ModBerry’s eth1 IP address.
1. Set up a NAT Port Forwarding rule on your router (e.g., pfSense)
This tells your router: “When someone connects to port 2223 on the public IP, forward that to port 22 on the ModBerry’s eth1 interface.”
2. From outside your network, connect using:
Replace user with your actual ModBerry username (e.g., root or pi), and YOUR_PUBLIC_ROUTER_IP with the WAN IP of your pfSense router.
Convert JPG Images to Optimized WebP
/in Uncategorized/by GénesisThis command creates optimized WebP versions of your JPG images while intelligently handling image sizes, only larger images are resized, and smaller ones are left unchanged. The original JPG files remain untouched, with new WebP versions created alongside them.
Slideshow Wallpaper in Ubuntu
/in Tooling/by GénesisYou can use easily Shotwell to create a dynamic wallpaper with your favorite images. First, install Shotwell if you haven’t already:
Then in Shotwell:
Inside out bouncing ball animation
/in CSS3/by GénesisA mostly CSS-only cool animation of a ball bouncing within a rectangle. We just need to capture the mouse position with JavaScript.