Setup transparent redirect of local traffic to proxy

Hi, I'm very new to openWRT, I'm looking for someone who could help to configure gl.inet a1300 router with OpenWRT 24 installed (no gl.inet shell there already, only luci, did it with image openwrt-24.10.1-ipq40xx-generic-glinet_gl-a1300-squashfs-factory.ubi but if required I can re-image it to other version).

Since I have no real qualification, I'm looking for specialists who could assist in reliable configuration for my purpose and sorry I used gpt to make description of what's required more transparent. If anyone could provide such service via upwork or other reliable channel, I'll be glad to chat - please DM.

What I managed to achieve by myself is only very basic setup with connection of radio0 to external wifi and creation of LAN network on radio1. After that I'm getting stuck with segfaults of redsocks and last nail into coffin, I don't know how to redirect to domain, not to IP - these are a bit complicated subjects for me. Lastly, and of course, since router has no gl.inet UI, I'm pretty confident there are many more settings which I need to re-apply to make installation work in a more secure way, but I dont even know from where to start.

Title:

OpenWRT Router Setup with Transparent SOCKS5 Proxy Routing

Objective:

Configure a GL.iNet A1300 router running OpenWRT 24 (or another compatible version) to:

  1. Connect to an external WiFi network (uplink)
  2. Provide a local WiFi access point to LAN clients
  3. Route all client web traffic (TCP ports 80 and 443) through a dynamic SOCKS5 proxy

Requirements:

  1. WAN via WiFi Client

    • Connect to WiFi: SSID: abc (WPA2; hidden SSID possible)
    • Should act as WAN/internet uplink
    • Must automatically reconnect on loss
  2. LAN via WiFi Access Point

    • Broadcast WiFi: SSID: xyz (WPA2 optional)
    • Serve local clients via DHCP
    • LAN and WAN must be on separate radios (no repeater/mesh)
    • Local clients should be unaware of proxy routing (transparent)
  3. Transparent SOCKS5 Proxy Routing

    • All HTTP (TCP 80) and HTTPS (TCP 443) traffic from LAN clients must be routed through:
      socks5://username:password@host.com:port
    • host.com is a dynamic DNS endpoint and must be resolved in real-time (not hardcoded as IP)
    • DNS resolution must be reliable and should not leak (if possible)

Deliverables:

  • Final router configuration files:

    • /etc/config/network
    • /etc/config/wireless
    • /etc/redsocks.conf (or alternative)
    • Any relevant /etc/firewall.user or custom routing scripts
  • Instructions:

    • How to install required packages
    • How to apply the configuration
    • How to verify proxy routing is working (e.g., with ipinfo.io)
    • Optional recovery/fallback steps if proxy becomes unreachable

Optional Bonus:

  • DNS-over-SOCKS support (e.g., via dns2socks or dnscrypt)
  • Automatic reconnect if WAN SSID becomes unavailable
  • Lightweight web panel or CLI for diagnostics

Skills Needed:

  • Advanced OpenWRT configuration
  • Familiarity with routing/NAT/firewall rules
  • Experience with transparent proxying via SOCKS5
  • Shell scripting

Notes:

  • This is NOT a repeater or extender setup
  • LAN and WAN WiFi networks are completely separate

Oddly, this other new user made a similar post recently:

hah, I also noticed I'm not alone in struggle, but tbh have nothing to do with another posting. I'm just looking to finish my 'new' home network setup and tired to sit till 2am every night this week. So i'd be even glad to pay to someone who will make this shy work as expected without guessing all the time

1 Like

I got redsocks up and running in less than 10 mins, it's really no rocket science....

if using nftables

create 99-redsocks.nft in /etc/nftables.d, and paste the following into it

chain REDSOCKS {
        # hook to the output/prerouting
        type nat hook prerouting priority dstnat; policy accept;

        # skip for local ip ranges
        ip daddr 0.0.0.0/8      return
        ip daddr 10.0.0.0/8     return
        ip daddr 100.64.0.0/10  return
        ip daddr 127.0.0.0/8    return
        ip daddr 169.254.0.0/16 return
        ip daddr 172.16.0.0/12  return
        ip daddr 192.168.0.0/16 return
        ip daddr 198.18.0.0/15  return
        ip daddr 224.0.0.0/4    return
        ip daddr 240.0.0.0/4    return

        # everything else tcp = redirect to redsocks
        ip protocol tcp redirect to 12345
}

restart the network service, or reboot the router afterwards.

if using iptables

install iptables iptables-mod-nat-extra in addition to redsocks, and apply the iptables rules found on internet, only slightly modified to match OpenWRT's LAN interface.

iptables -t nat -N REDSOCKS
iptables -t nat -A REDSOCKS -d 0.0.0.0/8 -j RETURN
iptables -t nat -A REDSOCKS -d 10.0.0.0/8 -j RETURN
iptables -t nat -A REDSOCKS -d 100.64.0.0/10 -j RETURN
iptables -t nat -A REDSOCKS -d 127.0.0.0/8 -j RETURN
iptables -t nat -A REDSOCKS -d 169.254.0.0/16 -j RETURN
iptables -t nat -A REDSOCKS -d 172.16.0.0/12 -j RETURN
iptables -t nat -A REDSOCKS -d 192.168.0.0/16 -j RETURN
iptables -t nat -A REDSOCKS -d 198.18.0.0/15 -j RETURN
iptables -t nat -A REDSOCKS -d 224.0.0.0/4 -j RETURN
iptables -t nat -A REDSOCKS -d 240.0.0.0/4 -j RETURN
iptables -t nat -A REDSOCKS -p tcp -j REDIRECT --to-ports 12345
iptables -t nat -A PREROUTING -i br-lan -p tcp -j REDSOCKS
iptables -A INPUT -i br-lan -p tcp --dport 12345 -j ACCEPT

Don't forget to customize your /etc/redsocks.conf file too.

not very pretty, but I suck at firewall rules, I still use shorewall (not on OpenWRT) :slight_smile:

1751008062.934829 info redsocks.c:1243 redsocks_accept_client(...) [192.168.1.157:53498->208.79.209.138:443]: accepted
1751008063.208377 debug redsocks.c:341 redsocks_start_relay(...) [192.168.1.157:53498->208.79.209.138:443]: data relaying started
1751008064.087770 info redsocks.c:671 redsocks_drop_client(...) [192.168.1.157:53498->208.79.209.138:443]: connection closed
1751008064.768139 info redsocks.c:1243 redsocks_accept_client(...) [192.168.1.157:53499->2.21.240.94:443]: accepted
1751008065.426704 debug redsocks.c:341 redsocks_start_relay(...) [192.168.1.157:53499->2.21.240.94:443]: data relaying started

yeah, something tells me it's the same user :wink:

not sure how to make it clear - I have same problem but i'm not cross-posting. with regards to your setup - it is clear where the difference is - you probably don't have Segfaults on running redsocks on your device, while GL A1300 has this despite installing of image from openwrt, then you probably redirect to IP, not a DOMAIN. so thanks for advice bro, but no, I need a bit more specific help, that's why I'm looking for someone who could spend time not saying 'on my side it is working' but kind of do the professional service

Are you saying you're attempting to use a domain to route IP traffic - and hence experiencing issues?

That's likely the cause of your segfaults.

Can you explain this statement.

  • Resolve domain to its IP
  • Use IP

few more things to clarify on situation

  1. I got brand new GL A1300
  2. I updated it via this procedure
  3. first I tried with sysupgrade image listed on this page https://openwrt.org/toh/gl.inet/gl-a1300, kind of openwrt owned, correct? it didn't work at all - router was not returning to normal mode after 20mins of waiting, reboots, poweroffs, etc.
  4. I again applied same procedure but with other image - factory image (https://downloads.openwrt.org/releases/24.10.0/targets/ipq40xx/generic/openwrt-24.10.0-ipq40xx-generic-glinet_gl-a1300-squashfs-factory.ubi) from same link https://openwrt.org/toh/gl.inet/gl-a1300
  5. after that I got router up and running, super-minimalistic setup which is so stupid that you even can't update opkg list via ssh because surprise it has some restrictions
  6. so all you can do then - is either configure via LUCI or uci which are 2 tools completely unknown to me as I don't knwo the arch and setup of hardware of this device, and honestly - don't even want to become a specialist in it.
  7. after some time spent i got wifi connection to external wifi via radio0 and lan wifi setup for clients on radio1.
  8. afther that I tried to install redsocks, got segfaults and spending 20h after decided to search for specialists who can do it and I simply pay for their work/guidance but it should be relevant - SAME device, same setup of redirect to domain.
1 Like
  • Oh, that may take some time - these forums are generally for users to get support while fixing thier own issues with community assistance
  • Be careful hiring randoms to setup your network gateway

no one forces you to use openwrt, feel free to revert back.

it doesn't, your network topology and upstream subnets might however make it fail.

1 Like

I do redirect to a DOMAIN, guess your mind reading skills took a day off today ...

it's not really offered here.

you could however upgrade to https://firmware-selector.openwrt.org/?version=24.10.2&target=ipq40xx%2Fgeneric&id=glinet_gl-a1300, which is what I'm using.

1 Like

via luci packages are being installed, via opkg - no. you could be right about upstream networks however they are not in my control.
regarding rest - do you run your setup on GL-a1300 or another device? do you run it with open wrt 24? if so, could you please provide a list of all packages installed - I will then request image with same list and will try to reproduce setup

1 Like

Im not a bank, also there are ways to validate the work, as always. specifically mirroring by setting up yourself

then don't blame openwrt the 1st thing you do ?

T-56, but it really shouldn't make any difference.

24.10.2

no point, hw is different, list will differ, install what you were told to install.
if you have no idea what you've done, reset 1st.

you'll have a hard time finding someone with an identical setup to yours ...

Exactly. Did you follow the steps, or is an exchange of money required before you mirror the steps and setup yourself?

(In other words - are you ignoring the instructions because you didn't pay for them?)

does a t-56 has 2 radios i.e. 2 hardware radio chips to be connected to wifi and simultaneously run another wifi for its own lan? I believe such things might complicate a bit setup, but frankly need a professional advice to be sure

1 Like

Does "professional" mean "paid" or "knowledgeable" in this case?

@frollic has been quite helpful.

install what you were told to install.
indeed, already running openwrt 24, from official device openwrt page. not sure it could be even more direct to what's recommended.

it should make zero difference - https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=1c05388ab04c934ec240e8362321908f91381a90

this is probably as professional as it'll ever get.
btw, did I already tell you I got no undies on ?

as for your uplink, go to the wifi section, scan for the uplink SSID, and join it.
move the new uplink connection to the wan firewall zone. done

make sure the uplink WAN subnet isn't the same as your LAN subnet on the A1300, or the routing will fail.

It's not clear why you posted the information already provided.

Are you asking how to install the packages?