Docs
Doc / Cases / subroute
Remote Access to Sub Router Devices
Legacy Notice: This guide uses OmniEdge v1.x for OpenWrt. OmniEdge v2.x for OpenWrt is coming soon. For new deployments on supported platforms, we recommend using OmniEdge v2.x.
Many WiFi devices (cameras, IoT sensors, smart home devices) cannot run VPN clients directly. This guide shows how to use an OpenWrt router as a gateway to access these devices remotely through OmniEdge.
Architecture
┌─────────────────────────────────────────────────────────────────┐
│ Remote Access Setup │
│ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Your Laptop │◄─────────►│ OpenWrt │ │
│ │ (OmniEdge) │ Mesh │ Router │ │
│ │ 100.100.100.1│ │100.100.100.46│ │
│ └──────────────┘ └──────┬───────┘ │
│ │ LAN │
│ ┌───────────────┼───────────────┐ │
│ │ │ │ │
│ ┌─────▼─────┐ ┌─────▼─────┐ ┌─────▼─────┐ │
│ │ Camera │ │ NAS │ │ Printer │ │
│ │192.168.1.2│ │192.168.1.3│ │192.168.1.4│ │
│ └───────────┘ └───────────┘ └───────────┘ │
└─────────────────────────────────────────────────────────────────┘Requirements
- OpenWrt router (v21.02 or earlier recommended)
- OmniEdge client on your laptop/PC
- OmniEdge v1.x OpenWrt package (v0.2.4)
Setup on OpenWrt Router
1. Download and Install OmniEdge
Download the appropriate package for your router's architecture from OmniEdge v0.2.4 Releases.
# Copy the ipk to your router, then install
opkg install omniedge*.ipk2. Configure OmniEdge
Generate a Security Key from OmniEdge Dashboard and note your Virtual Network ID.
Edit /etc/init.d/omniedge:
security_key=YOUR_OMNIEDGE_SECURITY_KEY
virtual_network_id=YOUR_VIRTUAL_NETWORK_ID3. Start OmniEdge
/etc/init.d/omniedge enable
/etc/init.d/omniedge start4. Configure Firewall Rules
Set up NAT and forwarding so your laptop can access devices on the router's LAN:
# Replace 100.100.100.0/24 with your virtual network IP range
iptables -t nat -A POSTROUTING -s 100.100.100.0/24 -j MASQUERADE
iptables -A forwarding_rule -s 100.100.100.0/24 -j ACCEPT
# Allow traffic from LAN to virtual network
LAN_DEV=$(ubus call network.interface.lan status | jsonfilter -e '@["device"]')
iptables -I FORWARD 1 -i $LAN_DEV -d 100.100.100.0/24 -j ACCEPT5. Make Firewall Rules Persistent
Create a hotplug script to apply rules on network restart:
cat > /etc/hotplug.d/iface/99-omniedge << 'EOF'
[ "${ACTION}" = "ifup" ] && {
logger -t hotplug "Device: ${DEVICE} / Action: ${ACTION}"
/etc/init.d/omniedge start &>/dev/null &
sleep 5
iptables -t nat -A POSTROUTING -s 100.100.100.0/24 -j MASQUERADE
iptables -A forwarding_rule -s 100.100.100.0/24 -j ACCEPT
LAN_DEV=$(ubus call network.interface.lan status | jsonfilter -e '@["device"]')
iptables -I FORWARD 1 -i $LAN_DEV -d 100.100.100.0/24 -j ACCEPT
}
EOFSetup on Client (Your Laptop)
Windows
- Install OmniEdge Desktop for Windows and connect to the same network as your OpenWrt router
- Open Command Prompt as Administrator and add a route:
route add 192.168.1.0 mask 255.255.255.0 100.100.100.46macOS
- Install OmniEdge CLI:
curl -fsSL https://raw.githubusercontent.com/omniedgeio/omniedge/main/scripts/omniedge-install.sh | bash
sudo omniedge start- Add a route:
sudo route -n add -net 192.168.1.0 100.100.100.46Linux
- Install OmniEdge CLI:
curl -fsSL https://raw.githubusercontent.com/omniedgeio/omniedge/main/scripts/omniedge-install.sh | bash
sudo omniedge start- Add a route:
sudo ip route add 192.168.1.0/24 via 100.100.100.46Parameters Explained
- 192.168.1.0/24: LAN IP range of your OpenWrt router
- 100.100.100.46: OmniEdge virtual IP of your OpenWrt router
Access LAN Devices
Once configured, you can access devices on your router's LAN using their local IPs:
# Access a camera
http://192.168.1.2
# SSH to a NAS
ssh user@192.168.1.3
# Print to a network printer
# Use 192.168.1.4 as the printer address
Future: OmniEdge v2.x for OpenWrt
OmniEdge v2.x brings improved NAT traversal and the WASM plugin system. OpenWrt support is planned for a future release.
If you have more questions, feel free to discuss.
On This Page