0

I have a 4G router connected to the NIC of a Ubuntu 18.04 server. I need to be able to use the public IP of the router to access the webpage hosted on the server. I have correctly configured port forwarding on the router (confirmed this by connecting a non-ubuntu device and port forwarding successfully to it) and still unsuccessful. The default route on the server is configured to the IP of the router. Using ufw I have dropped the firewall restrictions completely to the point where any connection should be able to be made.

/etc/default/uwf:

# /etc/default/ufw #

# Set to yes to apply rules to support IPv6 (no means only IPv6 on loopback
# accepted). You will need to 'disable' and then 'enable' the firewall for
# the changes to take affect.
IPV6=yes

# Set the default input policy to ACCEPT, DROP, or REJECT. Please note that if
# you change this you will most likely want to adjust your rules.
DEFAULT_INPUT_POLICY="ACCEPT"

# Set the default output policy to ACCEPT, DROP, or REJECT. Please note that if
# you change this you will most likely want to adjust your rules.
DEFAULT_OUTPUT_POLICY="ACCEPT"

# Set the default forward policy to ACCEPT, DROP or REJECT.  Please note that
# if you change this you will most likely want to adjust your rules
DEFAULT_FORWARD_POLICY="ACCEPT"

# Set the default application policy to ACCEPT, DROP, REJECT or SKIP. Please
# note that setting this to ACCEPT may be a security risk. See 'man ufw' for
# details
DEFAULT_APPLICATION_POLICY="SKIP"

# By default, ufw only touches its own chains. Set this to 'yes' to have ufw
# manage the built-in chains too. Warning: setting this to 'yes' will break
# non-ufw managed firewall rules
MANAGE_BUILTINS=no

root@server:/etc/ufw# ufw status verbose

Status: active
Logging: on (low)
Default: allow (incoming), allow (outgoing), allow (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
Anywhere                   ALLOW IN    10.20.0.0/24              
80                         ALLOW IN    Anywhere                  
80/tcp                     ALLOW IN    Anywhere                  
22/tcp                     ALLOW IN    Anywhere                  
22                         ALLOW IN    Anywhere                  
8088                       ALLOW IN    Anywhere                  
80 (v6)                    ALLOW IN    Anywhere (v6)             
80/tcp (v6)                ALLOW IN    Anywhere (v6)             
22/tcp (v6)                ALLOW IN    Anywhere (v6)             
22 (v6)                    ALLOW IN    Anywhere (v6)             
8088 (v6)                  ALLOW IN    Anywhere (v6)

Any suggestions on changes to allow port forwarding?

Barkles
  • 101
  • 1
  • 1
    Did you check the router has the port 80 open and is forwarding to the port 80 in the server (forwarding requieres a source port and destination port)? Are you sure the problem is the port forwarding and not the webserver? Did you try the webserver from another device in the lan? Did you setup virtualhosts? – Leo Gallego Jun 20 '18 at 05:17
  • It is unlikely that the 4G carrier is assigning a public IPv4 address to your router. You will not be able to forward a port on the carrier's NAT router. – Ron Maupin Jun 20 '18 at 05:36
  • @RonMaupin So what about the test where the OP replaced the Ubuntu by something else? – Gerard H. Pille Jun 20 '18 at 07:40
  • Do you have a server running and listening on port 80 on your Ubuntu? What does "netstat -rn" give? – Gerard H. Pille Jun 20 '18 at 07:41
  • The firewall and port forwarding were configured correctly, just a noob move of assigning a different default gateway to two different NICs. – Barkles Jun 21 '18 at 06:19

0 Answers0