Issues trying to forward a port on DD-WRT

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
uranux
DD-WRT Novice


Joined: 11 Jan 2024
Posts: 7

PostPosted: Thu Jan 11, 2024 13:35    Post subject: Issues trying to forward a port on DD-WRT Reply with quote
Hi there, I've been trying to forward a group of ports (21, 80, 443, etc) on my router, using the "NAT/QoS Port Forwarding" interface.

In fact, I had it working perfectly for some years, but one day, out of nowhere, it stoped working. So, after strugling for a while, I decided to upgrade the firmware (from v3.0-r46329 std to v3.0-r54682 std) I was using, but even so, I could not connect to these ports again anymore.


Firmware: DD-WRT v3.0-r54682 (01/02/24)
Router: TP-Link ARCHER-C7 v5

Settings under NAT/QoS > Port forwarding
Application: HTTP
Protocol: TCP
Source net:
Port from: 80
IP address: 192.168.1.XXX
Port to: 80
Enable: Y

I have also connected to the router using ssh and the dump of the command
"iptables -vnL FORWARD" is attached.

Any help with this would be greatly appreciated. Thanks!
Sponsor
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 3006
Location: Germany

PostPosted: Thu Jan 11, 2024 13:54    Post subject: Reply with quote
The output of the PREROUTING and FORWARD chain is required

iptables -t nat -vnL
iptables -vnL

However, your FORWARD chain shows that packets are arriving - so it works.

Also, don't mask private IP addresses - you know they are private?

_________________
Quickstart guides:
use Pi-Hole as simple DNS-Server with DD-WRT
VLAN configuration via GUI - 1 CPU port
VLAN configuration via GUI - 2 CPU ports (R7800, EA8500 etc)

Routers
Marvell OCTEON TX2 - QHora-322 - OpenWrt 23.05.3 - Gateway
Qualcomm IPQ8065 - R7800 - DD-WRT - WAP
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12923
Location: Netherlands

PostPosted: Thu Jan 11, 2024 13:58    Post subject: Reply with quote
Redacting RFC1918 addresses is not only useless , as they are private, but it makes it difficult to give the best possible support.

Assuming you did not allow remote administration (please show iptables -vnL -t nat) it looks like the port forwarding is working you can see the rules being hit.

Maybe nobody is home on the IP address you are forwarding too?

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
uranux
DD-WRT Novice


Joined: 11 Jan 2024
Posts: 7

PostPosted: Thu Jan 11, 2024 19:28    Post subject: Reply with quote
Hi ho1Aetoo,
Thanks for answering.

Output of the commands are:
(1)
Code:
root@aguia:~# iptables -t nat -vnL
Chain PREROUTING (policy ACCEPT 7916 packets, 1493K bytes)
 pkts bytes target     prot opt in     out     source               destination         
 2286 83978 DNAT       icmp --  *      *       0.0.0.0/0            177.x.x.x       to:192.168.1.1
  101  5609 DNAT       tcp  --  *      *       0.0.0.0/0            177.x.x.x       tcp dpt:80 to:192.168.1.199:80
   22  1068 DNAT       tcp  --  *      *       0.0.0.0/0            177.x.x.x       tcp dpt:443 to:192.168.1.199:443
    7   316 DNAT       tcp  --  *      *       0.0.0.0/0            177.x.x.x       tcp dpt:21 to:192.168.1.199:21
 1676 82201 TRIGGER    all  --  *      *       0.0.0.0/0            177.x.x.x      TRIGGER type:dnat match:0 relate:0

Chain INPUT (policy ACCEPT 4773 packets, 227K bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 875 packets, 59653 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain POSTROUTING (policy ACCEPT 996 packets, 65106 bytes)
 pkts bytes target     prot opt in     out     source               destination         
 4004 1103K SNAT       all  --  *      vlan2   192.168.1.0/24       0.0.0.0/0            to:177.x.x.x
    0     0 RETURN     all  --  *      br0     0.0.0.0/0            0.0.0.0/0            PKTTYPE = broadcast
    9  1692 MASQUERADE  all  --  *      br0     192.168.1.0/24       192.168.1.0/24


(2)
Code:
root@aguia:~# iptables -vnL
Chain INPUT (policy ACCEPT 9296 packets, 857K bytes)
 pkts bytes target     prot opt in     out     source               destination         
   33  1356 DROP       tcp  --  vlan2  *       0.0.0.0/0            0.0.0.0/0            tcp dpt:8080
    0     0 DROP       tcp  --  vlan2  *       0.0.0.0/0            0.0.0.0/0            tcp dpt:80
    0     0 DROP       tcp  --  vlan2  *       0.0.0.0/0            0.0.0.0/0            tcp dpt:443
    1    44 DROP       tcp  --  vlan2  *       0.0.0.0/0            0.0.0.0/0            tcp dpt:69
   37  1808 DROP       tcp  --  vlan2  *       0.0.0.0/0            0.0.0.0/0            tcp dpt:22
  101  5328 DROP       tcp  --  vlan2  *       0.0.0.0/0            0.0.0.0/0            tcp dpt:23

Chain FORWARD (policy ACCEPT 87 packets, 4476 bytes)
 pkts bytes target     prot opt in     out     source               destination         
76450   31M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
 5572 1734K upnp       all  --  *      *       0.0.0.0/0            0.0.0.0/0           
 5572 1734K lan2wan    all  --  *      *       0.0.0.0/0            0.0.0.0/0           
    0     0 ACCEPT     all  --  br0    br0     0.0.0.0/0            0.0.0.0/0           
    0     0 ACCEPT     udp  --  vlan2  *       0.0.0.0/0            224.0.0.0/4         
  102  5753 ACCEPT     tcp  --  vlan2  *       0.0.0.0/0            192.168.1.199        tcp dpt:80
   23  1148 ACCEPT     tcp  --  vlan2  *       0.0.0.0/0            192.168.1.199        tcp dpt:443
    7   332 ACCEPT     tcp  --  vlan2  *       0.0.0.0/0            192.168.1.199        tcp dpt:21
    0     0 TRIGGER    all  --  vlan2  br0     0.0.0.0/0            0.0.0.0/0           TRIGGER type:in match:0 relate:0
 5440 1727K trigger_out  all  --  br0    *       0.0.0.0/0            0.0.0.0/0           
    0     0 TRIGGER    all  --  vlan2  eth0    0.0.0.0/0            0.0.0.0/0           TRIGGER type:in match:0 relate:0
    0     0 trigger_out  all  --  eth0   *       0.0.0.0/0            0.0.0.0/0           
    0     0 ACCEPT     all  --  eth0   *       0.0.0.0/0            0.0.0.0/0            state NEW
    0     0 TRIGGER    all  --  vlan2  vlan1   0.0.0.0/0            0.0.0.0/0           TRIGGER type:in match:0 relate:0
    0     0 trigger_out  all  --  vlan1  *       0.0.0.0/0            0.0.0.0/0           
    0     0 ACCEPT     all  --  vlan1  *       0.0.0.0/0            0.0.0.0/0            state NEW
    0     0 TRIGGER    all  --  vlan2  wlan0   0.0.0.0/0            0.0.0.0/0           TRIGGER type:in match:0 relate:0
    0     0 trigger_out  all  --  wlan0  *       0.0.0.0/0            0.0.0.0/0           
    0     0 ACCEPT     all  --  wlan0  *       0.0.0.0/0            0.0.0.0/0            state NEW
    0     0 TRIGGER    all  --  vlan2  wlan1   0.0.0.0/0            0.0.0.0/0           TRIGGER type:in match:0 relate:0
    0     0 trigger_out  all  --  wlan1  *       0.0.0.0/0            0.0.0.0/0           
    0     0 ACCEPT     all  --  wlan1  *       0.0.0.0/0            0.0.0.0/0            state NEW
 5353 1722K ACCEPT     all  --  br0    *       0.0.0.0/0            0.0.0.0/0            state NEW

Chain OUTPUT (policy ACCEPT 9407 packets, 1899K bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_1 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_10 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_11 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_12 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_13 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_14 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_15 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_16 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_17 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_18 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_19 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_2 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_20 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_3 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_4 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_5 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_6 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_7 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_8 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_9 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_1 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_10 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_11 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_12 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_13 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_14 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_15 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_16 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_17 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_18 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_19 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_2 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_20 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_3 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_4 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_5 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_6 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_7 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_8 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_9 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain lan2wan (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain trigger_out (5 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain upnp (1 references)
 pkts bytes target     prot opt in     out     source               destination



(3)
Also, don't mask private IP addresses - you know they are private?
No, I believe the ip address is public: Mod edit: Screenshot was redacted in error, no need to share public IP.


Last edited by uranux on Thu Jan 11, 2024 20:29; edited 2 times in total
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14249
Location: Texas, USA

PostPosted: Thu Jan 11, 2024 19:34    Post subject: Reply with quote
I edited your post(s) to make them more readable and to redact your public IP for security reasons. If you know that the IP address is public and wish to redact it, that is fine and good practice.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net


Last edited by kernel-panic69 on Thu Jan 11, 2024 21:17; edited 1 time in total
uranux
DD-WRT Novice


Joined: 11 Jan 2024
Posts: 7

PostPosted: Thu Jan 11, 2024 19:35    Post subject: Reply with quote
Hi egc,

Thanks for answering.

Redacting RFC1918 addresses is not only useless, as they are private, but it makes it difficult to give the best possible support.
-> I must confess I do not understand what you mean here.

Assuming you did not allow remote administration (please show iptables -vnL -t nat) it looks like the port forwarding is working you can see the rules being hit.
-> command output:
Code:
root@aguia:~# iptables -vnL
Chain INPUT (policy ACCEPT 9296 packets, 857K bytes)
 pkts bytes target     prot opt in     out     source               destination         
   33  1356 DROP       tcp  --  vlan2  *       0.0.0.0/0            0.0.0.0/0            tcp dpt:8080
    0     0 DROP       tcp  --  vlan2  *       0.0.0.0/0            0.0.0.0/0            tcp dpt:80
    0     0 DROP       tcp  --  vlan2  *       0.0.0.0/0            0.0.0.0/0            tcp dpt:443
    1    44 DROP       tcp  --  vlan2  *       0.0.0.0/0            0.0.0.0/0            tcp dpt:69
   37  1808 DROP       tcp  --  vlan2  *       0.0.0.0/0            0.0.0.0/0            tcp dpt:22
  101  5328 DROP       tcp  --  vlan2  *       0.0.0.0/0            0.0.0.0/0            tcp dpt:23

Chain FORWARD (policy ACCEPT 87 packets, 4476 bytes)
 pkts bytes target     prot opt in     out     source               destination         
76450   31M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
 5572 1734K upnp       all  --  *      *       0.0.0.0/0            0.0.0.0/0           
 5572 1734K lan2wan    all  --  *      *       0.0.0.0/0            0.0.0.0/0           
    0     0 ACCEPT     all  --  br0    br0     0.0.0.0/0            0.0.0.0/0           
    0     0 ACCEPT     udp  --  vlan2  *       0.0.0.0/0            224.0.0.0/4         
  102  5753 ACCEPT     tcp  --  vlan2  *       0.0.0.0/0            192.168.1.199        tcp dpt:80
   23  1148 ACCEPT     tcp  --  vlan2  *       0.0.0.0/0            192.168.1.199        tcp dpt:443
    7   332 ACCEPT     tcp  --  vlan2  *       0.0.0.0/0            192.168.1.199        tcp dpt:21
    0     0 TRIGGER    all  --  vlan2  br0     0.0.0.0/0            0.0.0.0/0           TRIGGER type:in match:0 relate:0
 5440 1727K trigger_out  all  --  br0    *       0.0.0.0/0            0.0.0.0/0           
    0     0 TRIGGER    all  --  vlan2  eth0    0.0.0.0/0            0.0.0.0/0           TRIGGER type:in match:0 relate:0
    0     0 trigger_out  all  --  eth0   *       0.0.0.0/0            0.0.0.0/0           
    0     0 ACCEPT     all  --  eth0   *       0.0.0.0/0            0.0.0.0/0            state NEW
    0     0 TRIGGER    all  --  vlan2  vlan1   0.0.0.0/0            0.0.0.0/0           TRIGGER type:in match:0 relate:0
    0     0 trigger_out  all  --  vlan1  *       0.0.0.0/0            0.0.0.0/0           
    0     0 ACCEPT     all  --  vlan1  *       0.0.0.0/0            0.0.0.0/0            state NEW
    0     0 TRIGGER    all  --  vlan2  wlan0   0.0.0.0/0            0.0.0.0/0           TRIGGER type:in match:0 relate:0
    0     0 trigger_out  all  --  wlan0  *       0.0.0.0/0            0.0.0.0/0           
    0     0 ACCEPT     all  --  wlan0  *       0.0.0.0/0            0.0.0.0/0            state NEW
    0     0 TRIGGER    all  --  vlan2  wlan1   0.0.0.0/0            0.0.0.0/0           TRIGGER type:in match:0 relate:0
    0     0 trigger_out  all  --  wlan1  *       0.0.0.0/0            0.0.0.0/0           
    0     0 ACCEPT     all  --  wlan1  *       0.0.0.0/0            0.0.0.0/0            state NEW
 5353 1722K ACCEPT     all  --  br0    *       0.0.0.0/0            0.0.0.0/0            state NEW

Chain OUTPUT (policy ACCEPT 9407 packets, 1899K bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_1 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_10 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_11 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_12 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_13 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_14 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_15 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_16 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_17 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_18 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_19 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_2 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_20 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_3 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_4 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_5 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_6 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_7 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_8 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain advgrp_9 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_1 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_10 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_11 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_12 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_13 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_14 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_15 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_16 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_17 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_18 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_19 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_2 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_20 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_3 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_4 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_5 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_6 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_7 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_8 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain grp_9 (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain lan2wan (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain trigger_out (5 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain upnp (1 references)
 pkts bytes target     prot opt in     out     source               destination



Maybe nobody is home on the IP address you are forwarding too?
-> The address to which it is forwarded is the one of localhost (192.168.1.199)
Code:
[guest@ol82 ~]# ifconfig
bridge0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.199  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::b03a:78ef:66e4:a9b1  prefixlen 64  scopeid 0x20<link>
        ether a4:1f:72:f6:aa:d1  txqueuelen 1000  (Ethernet)
        RX packets 627298  bytes 1127436221 (1.0 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 365200  bytes 41267887 (39.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether a4:1f:72:f6:aa:d1  txqueuelen 1000  (Ethernet)
        RX packets 831415  bytes 1154350963 (1.0 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 367791  bytes 42966594 (40.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16 

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Loopback Local)
        RX packets 1986281  bytes 496710845 (473.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1986281  bytes 496710845 (473.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:d7:45:04  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


Last edited by uranux on Thu Jan 11, 2024 20:01; edited 1 time in total
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 3006
Location: Germany

PostPosted: Thu Jan 11, 2024 19:35    Post subject: Reply with quote
And what should we do with it? These are definitely not the iptables rules of your dd-wrt router

You should run the command on your router and not on any other device.

uranux wrote:
No, I believe the ip address is public:


uranux wrote:
IP address: 192.168.1.XXX


192.168.1.XXX <- Since when is that a public IP address?

and you have also hidden the address in your screenshot.

_________________
Quickstart guides:
use Pi-Hole as simple DNS-Server with DD-WRT
VLAN configuration via GUI - 1 CPU port
VLAN configuration via GUI - 2 CPU ports (R7800, EA8500 etc)

Routers
Marvell OCTEON TX2 - QHora-322 - OpenWrt 23.05.3 - Gateway
Qualcomm IPQ8065 - R7800 - DD-WRT - WAP
uranux
DD-WRT Novice


Joined: 11 Jan 2024
Posts: 7

PostPosted: Thu Jan 11, 2024 20:03    Post subject: Reply with quote
Hi ho1Aetoo,

Thanks once more. My mistake, I executed the iptables command at another host.
I have edited the previous posts correcting it.

Thank you very much for your patience!
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14249
Location: Texas, USA

PostPosted: Thu Jan 11, 2024 20:12    Post subject: Reply with quote
The redacted address is 177.*.*.* and is public, hence my edit to the post. This may have been confusion on @uranux' part, but that was the IP range he posted and I connected it with the redacted screenshot, which probably actually showed the 192.168.1.199 address. Either way, no public IP addresses should be posted for the sake of keeping everyone honest. Sorry for your gears getting ground smooth over trivial mistakes.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 3006
Location: Germany

PostPosted: Thu Jan 11, 2024 20:24    Post subject: Reply with quote
@uranux

According to the table it works, packets arrive on ports 80,443,21 and are also forwarded

Are you testing the ports from an external host or from an internal one?

You can only test this with real certainty from an external host and if packets arrive there, it is most likely due to the destination system whose ports are closed or that the firewall does not allow access from the WAN.

_________________
Quickstart guides:
use Pi-Hole as simple DNS-Server with DD-WRT
VLAN configuration via GUI - 1 CPU port
VLAN configuration via GUI - 2 CPU ports (R7800, EA8500 etc)

Routers
Marvell OCTEON TX2 - QHora-322 - OpenWrt 23.05.3 - Gateway
Qualcomm IPQ8065 - R7800 - DD-WRT - WAP


Last edited by ho1Aetoo on Thu Jan 11, 2024 20:34; edited 1 time in total
uranux
DD-WRT Novice


Joined: 11 Jan 2024
Posts: 7

PostPosted: Thu Jan 11, 2024 20:31    Post subject: Reply with quote
Thank you kernel-panic69!

I have edit my post and replaced the real ip address with 177.x.x.x.
uranux
DD-WRT Novice


Joined: 11 Jan 2024
Posts: 7

PostPosted: Thu Jan 11, 2024 20:37    Post subject: Reply with quote
Hi ho1Aetoo,

Are you testing the ports from an external host or from an internal one?
-> From an internal host, it works
[guest@internal-host]# telnet 177.X.X.X 21
Trying 177.X.X.X...
Connected to 177.X.X.X.
Escape character is '^]'.
220 FTP Server ready.

But not from a VPS
[guest@external-host]# telnet 177.X.X.X 21
Trying 177.X.X.X...
telnet: connect to address 177.X.X.X: Connection timed out

Thank you very much.
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 3006
Location: Germany

PostPosted: Thu Jan 11, 2024 20:47    Post subject: Reply with quote
Restart the router/firewall and then try to connect through your VPS only.

Then check the PREROUTING table on your router to see if packets are arriving.

Chain PREROUTING (policy ACCEPT 7916 packets, 1493K bytes)
pkts bytes target prot opt in out source destination
101 5609 DNAT tcp -- * * 0.0.0.0/0 177.x.x.x tcp dpt:80 to:192.168.1.199:80
22 1068 DNAT tcp -- * * 0.0.0.0/0 177.x.x.x tcp dpt:443 to:192.168.1.199:443
7 316 DNAT tcp -- * * 0.0.0.0/0 177.x.x.x tcp dpt:21 to:192.168.1.199:21

If no packets arrive there and 0 is displayed, this is probably due to your Internet provider, which may be using CGNAT and therefore no port forwarding is possible

_________________
Quickstart guides:
use Pi-Hole as simple DNS-Server with DD-WRT
VLAN configuration via GUI - 1 CPU port
VLAN configuration via GUI - 2 CPU ports (R7800, EA8500 etc)

Routers
Marvell OCTEON TX2 - QHora-322 - OpenWrt 23.05.3 - Gateway
Qualcomm IPQ8065 - R7800 - DD-WRT - WAP
uranux
DD-WRT Novice


Joined: 11 Jan 2024
Posts: 7

PostPosted: Thu Jan 11, 2024 22:52    Post subject: Reply with quote
Hi ho1Aetoo,

Thank you once more.

It realy looks like everything is fine, but still no connection is done from VPS host.

As you mentioned, I also believe the problem may be due to any kind of rules changed by my ISP. However, I wanted to check if it could be caused by any other problem with the configuration of my router or even a hardware issue.

As I said on the first post, I have been using Port Forward with DD-WRT for many years without problems. I will try to solve it hiring another ISP.

Thank you very much for your help.

root@aguia:~# iptables -L -n -t nat
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
DNAT icmp -- 0.0.0.0/0 177.X.X.X to:192.168.1.1
DNAT tcp -- 0.0.0.0/0 177.X.X.X tcp dpt:80 to:192.168.1.199:80
DNAT tcp -- 0.0.0.0/0 177.X.X.X tcp dpt:443 to:192.168.1.199:443
DNAT tcp -- 0.0.0.0/0 177.X.X.X tcp dpt:21 to:192.168.1.199:21
TRIGGER all -- 0.0.0.0/0 177.X.X.X TRIGGER type:dnat match:0 relate:0

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
SNAT all -- 192.168.1.0/24 0.0.0.0/0 to:177.X.X.X
RETURN all -- 0.0.0.0/0 0.0.0.0/0 PKTTYPE = broadcast
MASQUERADE all -- 192.168.1.0/24 192.168.1.0/24
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 3006
Location: Germany

PostPosted: Fri Jan 12, 2024 7:26    Post subject: Reply with quote
You are using the wrong command - it does not display any packages...

the command is still "iptables -t nat -vnL"

_________________
Quickstart guides:
use Pi-Hole as simple DNS-Server with DD-WRT
VLAN configuration via GUI - 1 CPU port
VLAN configuration via GUI - 2 CPU ports (R7800, EA8500 etc)

Routers
Marvell OCTEON TX2 - QHora-322 - OpenWrt 23.05.3 - Gateway
Qualcomm IPQ8065 - R7800 - DD-WRT - WAP
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum