1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

Port Forwarding via Terminal on ASUS RT-AC3200

Discussion in 'Asuswrt-Merlin' started by blacksheep, Jul 19, 2019.

  1. blacksheep

    blacksheep Occasional Visitor

    Joined:
    Dec 11, 2015
    Messages:
    13
    Running Merlin firmware v384.10 on an ASUS RT-AC3200.
    I have never had an issue with this before and I've been running this firmware for some time.

    TL;DR: Can I manage port forwarding via the routers' ssh terminal?

    I added a new computer to my network.

    I installed plex media server and successfully updated port forwarding for Plex in the AC3200 Virtual Server/Port Forwarding Tab GUI (inside the WAN tab).
    I also have installed Apache to serve my web pages but the Virtual Server/Port Forwarding GUI fails to update or delete that port forwarding assignment.

    I am connected to the router through a SSH connection.
    I was hoping there was a command I can run in the terminal of the router and adjust that obsolete port forwarding assignment.

    I need to remove 192.168.1.143 forwarding to port 80
    I need to add 192.168.1.92 to forward to port 80

    I found nat_rules_eth0_eth0 and redirect_rules inside the tmp folder but I don't know if that is where I need to make the adjustment AND whether that change will stick through a reboot.
    I tried to change those but the change is not reflected in the GUI.
     
    Last edited: Jul 19, 2019
  2. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    9,119
    Location:
    UK
    blacksheep likes this.
  3. blacksheep

    blacksheep Occasional Visitor

    Joined:
    Dec 11, 2015
    Messages:
    13
    ** update** Thank you. It seems I was out of space. I cleared a log file and it gave me enough room. Perhaps this is why my firmware updates are also failing. Should my /dev/root/ be 100%? I've never noticed that before. Is it normal?

    Here are my memory and nvram readings:
    Memory: Free: 34.97 MB
    NVRAM usage 62203 / 131072 bytes

    I notice /dev/root seems full. How can I do housekeeping without blowing it away?

    Also df command yielded:
    Code:
    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/root                32512     32512         0 100% /
    devtmpfs                127576         0    127576   0% /dev
    tmpfs                   127716      2796    124920   2% /tmp
    /dev/mtdblock4           65536      5308     60228   8% /jffs
    
     
    Last edited: Jul 19, 2019
  4. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    9,119
    Location:
    UK
    What does this show? Does it contain any invalid characters?
    Code:
    nvram get vts_rulelist
     
  5. blacksheep

    blacksheep Occasional Visitor

    Joined:
    Dec 11, 2015
    Messages:
    13
    I have 22 short and simple entries.
    For example: <piPLEX>32400>192.168.1.91>32400>BOTH>

    I have 4 raspberry pi's, and they all do different stuff and require their respective ports to communicate with the outside world and with each other. There are no invalid characters, though.
     
  6. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    9,119
    Location:
    UK
    /dev/root is normally 100% full because it's ROM. Everything else looks OK also.

    It's quite possible that there wasn't enough free memory to update the firmware. Ejecting any USB drives and rebooting the router usually frees up enough memory to perform a firmware update.

    I can't think why any of that would effect your port forwarding rules though, unless there are so many that you've hit some kind on limit on the length of the nvram variable. EDIT: It looks like the limit on that variable is 8192 characters, so I guess it's not that then.
     
    blacksheep likes this.
  7. blacksheep

    blacksheep Occasional Visitor

    Joined:
    Dec 11, 2015
    Messages:
    13
    I checked and I have 901 characters including spaces. My port forwarding is working now. I'll try a firmware upgrade tonight. Wish me luck!! Thank you again for your attention and help.