Redirect web server from port 5000 to port 80 on localhost (Fedora, firewall-cmd)How can I move firewall settings from one Debian Squeeze web server to another?Firewall config prevents hibernate connecting to postgres in CentOS6.3Allowing web server communication in Linux firewalliptables - Redirect web traffic to LAN ServerFedora 21 Port Forwarding with firewalld (firewall-cmd); how does it REALLY work? Or, does it?How check a port forwarded from localhost to localhost on.. localhost?startx fails fedora 23firewall-cmd does not block port specifiedwhy doesn't port 80 show up via firewall-cmd command?Port forward from external postgresql to localhost

Which country benefited the most from UN Security Council vetoes?

Why doesn't H₄O²⁺ exist?

Add text to same line using sed

Replacing matching entries in one column of a file by another column from a different file

What would happen to a modern skyscraper if it rains micro blackholes?

meaning of に in 本当に?

What does the "remote control" for a QF-4 look like?

A newer friend of my brother's gave him a load of baseball cards that are supposedly extremely valuable. Is this a scam?

Revoked SSL certificate

Why can't we play rap on piano?

I'm flying to France today and my passport expires in less than 2 months

What typically incentivizes a professor to change jobs to a lower ranking university?

Do I have a twin with permutated remainders?

Arrow those variables!

LWC SFDX source push error TypeError: LWC1009: decl.moveTo is not a function

dbcc cleantable batch size explanation

What's the output of a record needle playing an out-of-speed record

What does "Puller Prush Person" mean?

Can an x86 CPU running in real mode be considered to be basically an 8086 CPU?

Codimension of non-flat locus

Is it legal for company to use my work email to pretend I still work there?

Can a Cauchy sequence converge for one metric while not converging for another?

DC-DC converter from low voltage at high current, to high voltage at low current

infared filters v nd



Redirect web server from port 5000 to port 80 on localhost (Fedora, firewall-cmd)


How can I move firewall settings from one Debian Squeeze web server to another?Firewall config prevents hibernate connecting to postgres in CentOS6.3Allowing web server communication in Linux firewalliptables - Redirect web traffic to LAN ServerFedora 21 Port Forwarding with firewalld (firewall-cmd); how does it REALLY work? Or, does it?How check a port forwarded from localhost to localhost on.. localhost?startx fails fedora 23firewall-cmd does not block port specifiedwhy doesn't port 80 show up via firewall-cmd command?Port forward from external postgresql to localhost






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















On Fedora 24, a web server (Node.js) is running (standalone, no apache/nginx) on port 5000.
http://localhost:5000 works



How to make it accessible on port 80?



Tried this



systemctl restart firewalld
firewall-cmd --add-service=http --permanent
firewall-cmd --add-masquerade --permanent
firewall-cmd --add-forward-port=port=80:proto=tcp:toport=5000
firewall-cmd --list-all
FedoraWorkstation (active)
target: default
icmp-block-inversion: no
interfaces: wlp3s0
sources:
services: mdns ssh dhcpv6-client samba-client https http
ports: 1025-65535/tcp 1025-65535/udp
protocols:
masquerade: yes
forward-ports: port=80:proto=tcp:toport=5000:toaddr=
source-ports:
icmp-blocks:
rich rules:


Additional info
Tried all the above with --zone=external too



Running node as root on port 80 works. Note, there's no IPv4:



netstat -tpln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
tcp 0 0 0.0.0.0:4433 0.0.0.0:* LISTEN 3977/deluge-gtk
tcp 0 0 0.0.0.0:51157 0.0.0.0:* LISTEN 3977/deluge-gtk
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 900/postgres
tcp 0 0 0.0.0.0:17500 0.0.0.0:* LISTEN 3203/dropbox
tcp 0 0 127.0.0.1:17600 0.0.0.0:* LISTEN 3203/dropbox
tcp 0 0 127.0.0.1:17603 0.0.0.0:* LISTEN 3203/dropbox
tcp6 0 0 :::111 :::* LISTEN 1/systemd
tcp6 0 0 :::4433 :::* LISTEN 3977/deluge-gtk
tcp6 0 0 :::51157 :::* LISTEN 3977/deluge-gtk
tcp6 0 0 :::5432 :::* LISTEN 900/postgres
tcp6 0 0 :::17500 :::* LISTEN 3203/dropbox
tcp6 0 0 :::34017 :::* LISTEN 10532/code
tcp6 0 0 :::5858 :::* LISTEN 30394/node
tcp6 0 0 :::5000 :::* LISTEN 30394/node









share|improve this question














bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.





















    1















    On Fedora 24, a web server (Node.js) is running (standalone, no apache/nginx) on port 5000.
    http://localhost:5000 works



    How to make it accessible on port 80?



    Tried this



    systemctl restart firewalld
    firewall-cmd --add-service=http --permanent
    firewall-cmd --add-masquerade --permanent
    firewall-cmd --add-forward-port=port=80:proto=tcp:toport=5000
    firewall-cmd --list-all
    FedoraWorkstation (active)
    target: default
    icmp-block-inversion: no
    interfaces: wlp3s0
    sources:
    services: mdns ssh dhcpv6-client samba-client https http
    ports: 1025-65535/tcp 1025-65535/udp
    protocols:
    masquerade: yes
    forward-ports: port=80:proto=tcp:toport=5000:toaddr=
    source-ports:
    icmp-blocks:
    rich rules:


    Additional info
    Tried all the above with --zone=external too



    Running node as root on port 80 works. Note, there's no IPv4:



    netstat -tpln
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
    tcp 0 0 0.0.0.0:4433 0.0.0.0:* LISTEN 3977/deluge-gtk
    tcp 0 0 0.0.0.0:51157 0.0.0.0:* LISTEN 3977/deluge-gtk
    tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 900/postgres
    tcp 0 0 0.0.0.0:17500 0.0.0.0:* LISTEN 3203/dropbox
    tcp 0 0 127.0.0.1:17600 0.0.0.0:* LISTEN 3203/dropbox
    tcp 0 0 127.0.0.1:17603 0.0.0.0:* LISTEN 3203/dropbox
    tcp6 0 0 :::111 :::* LISTEN 1/systemd
    tcp6 0 0 :::4433 :::* LISTEN 3977/deluge-gtk
    tcp6 0 0 :::51157 :::* LISTEN 3977/deluge-gtk
    tcp6 0 0 :::5432 :::* LISTEN 900/postgres
    tcp6 0 0 :::17500 :::* LISTEN 3203/dropbox
    tcp6 0 0 :::34017 :::* LISTEN 10532/code
    tcp6 0 0 :::5858 :::* LISTEN 30394/node
    tcp6 0 0 :::5000 :::* LISTEN 30394/node









    share|improve this question














    bumped to the homepage by Community 2 days ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

















      1












      1








      1








      On Fedora 24, a web server (Node.js) is running (standalone, no apache/nginx) on port 5000.
      http://localhost:5000 works



      How to make it accessible on port 80?



      Tried this



      systemctl restart firewalld
      firewall-cmd --add-service=http --permanent
      firewall-cmd --add-masquerade --permanent
      firewall-cmd --add-forward-port=port=80:proto=tcp:toport=5000
      firewall-cmd --list-all
      FedoraWorkstation (active)
      target: default
      icmp-block-inversion: no
      interfaces: wlp3s0
      sources:
      services: mdns ssh dhcpv6-client samba-client https http
      ports: 1025-65535/tcp 1025-65535/udp
      protocols:
      masquerade: yes
      forward-ports: port=80:proto=tcp:toport=5000:toaddr=
      source-ports:
      icmp-blocks:
      rich rules:


      Additional info
      Tried all the above with --zone=external too



      Running node as root on port 80 works. Note, there's no IPv4:



      netstat -tpln
      Active Internet connections (only servers)
      Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
      tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
      tcp 0 0 0.0.0.0:4433 0.0.0.0:* LISTEN 3977/deluge-gtk
      tcp 0 0 0.0.0.0:51157 0.0.0.0:* LISTEN 3977/deluge-gtk
      tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 900/postgres
      tcp 0 0 0.0.0.0:17500 0.0.0.0:* LISTEN 3203/dropbox
      tcp 0 0 127.0.0.1:17600 0.0.0.0:* LISTEN 3203/dropbox
      tcp 0 0 127.0.0.1:17603 0.0.0.0:* LISTEN 3203/dropbox
      tcp6 0 0 :::111 :::* LISTEN 1/systemd
      tcp6 0 0 :::4433 :::* LISTEN 3977/deluge-gtk
      tcp6 0 0 :::51157 :::* LISTEN 3977/deluge-gtk
      tcp6 0 0 :::5432 :::* LISTEN 900/postgres
      tcp6 0 0 :::17500 :::* LISTEN 3203/dropbox
      tcp6 0 0 :::34017 :::* LISTEN 10532/code
      tcp6 0 0 :::5858 :::* LISTEN 30394/node
      tcp6 0 0 :::5000 :::* LISTEN 30394/node









      share|improve this question














      On Fedora 24, a web server (Node.js) is running (standalone, no apache/nginx) on port 5000.
      http://localhost:5000 works



      How to make it accessible on port 80?



      Tried this



      systemctl restart firewalld
      firewall-cmd --add-service=http --permanent
      firewall-cmd --add-masquerade --permanent
      firewall-cmd --add-forward-port=port=80:proto=tcp:toport=5000
      firewall-cmd --list-all
      FedoraWorkstation (active)
      target: default
      icmp-block-inversion: no
      interfaces: wlp3s0
      sources:
      services: mdns ssh dhcpv6-client samba-client https http
      ports: 1025-65535/tcp 1025-65535/udp
      protocols:
      masquerade: yes
      forward-ports: port=80:proto=tcp:toport=5000:toaddr=
      source-ports:
      icmp-blocks:
      rich rules:


      Additional info
      Tried all the above with --zone=external too



      Running node as root on port 80 works. Note, there's no IPv4:



      netstat -tpln
      Active Internet connections (only servers)
      Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
      tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
      tcp 0 0 0.0.0.0:4433 0.0.0.0:* LISTEN 3977/deluge-gtk
      tcp 0 0 0.0.0.0:51157 0.0.0.0:* LISTEN 3977/deluge-gtk
      tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 900/postgres
      tcp 0 0 0.0.0.0:17500 0.0.0.0:* LISTEN 3203/dropbox
      tcp 0 0 127.0.0.1:17600 0.0.0.0:* LISTEN 3203/dropbox
      tcp 0 0 127.0.0.1:17603 0.0.0.0:* LISTEN 3203/dropbox
      tcp6 0 0 :::111 :::* LISTEN 1/systemd
      tcp6 0 0 :::4433 :::* LISTEN 3977/deluge-gtk
      tcp6 0 0 :::51157 :::* LISTEN 3977/deluge-gtk
      tcp6 0 0 :::5432 :::* LISTEN 900/postgres
      tcp6 0 0 :::17500 :::* LISTEN 3203/dropbox
      tcp6 0 0 :::34017 :::* LISTEN 10532/code
      tcp6 0 0 :::5858 :::* LISTEN 30394/node
      tcp6 0 0 :::5000 :::* LISTEN 30394/node






      fedora iptables firewall port-forwarding






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 11 '17 at 6:06









      Marius AndreianaMarius Andreiana

      1062




      1062





      bumped to the homepage by Community 2 days ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 2 days ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






















          1 Answer
          1






          active

          oldest

          votes


















          0














          firewall-cmd --add-service=http --permanent
          firewall-cmd --add-service=https --permanent
          firewall-cmd --add-masquerade --permanent
          firewall-cmd --add-forward-port=port=80:proto=tcp:toport=5000 --permanent

          #make port forwarding work on localhost
          iptables -t nat -I OUTPUT --source 127.0.0.1 --destination 127.0.0.1 -p tcp --dport 80 -j REDIRECT --to-ports 5000





          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f364333%2fredirect-web-server-from-port-5000-to-port-80-on-localhost-fedora-firewall-cmd%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            firewall-cmd --add-service=http --permanent
            firewall-cmd --add-service=https --permanent
            firewall-cmd --add-masquerade --permanent
            firewall-cmd --add-forward-port=port=80:proto=tcp:toport=5000 --permanent

            #make port forwarding work on localhost
            iptables -t nat -I OUTPUT --source 127.0.0.1 --destination 127.0.0.1 -p tcp --dport 80 -j REDIRECT --to-ports 5000





            share|improve this answer



























              0














              firewall-cmd --add-service=http --permanent
              firewall-cmd --add-service=https --permanent
              firewall-cmd --add-masquerade --permanent
              firewall-cmd --add-forward-port=port=80:proto=tcp:toport=5000 --permanent

              #make port forwarding work on localhost
              iptables -t nat -I OUTPUT --source 127.0.0.1 --destination 127.0.0.1 -p tcp --dport 80 -j REDIRECT --to-ports 5000





              share|improve this answer

























                0












                0








                0







                firewall-cmd --add-service=http --permanent
                firewall-cmd --add-service=https --permanent
                firewall-cmd --add-masquerade --permanent
                firewall-cmd --add-forward-port=port=80:proto=tcp:toport=5000 --permanent

                #make port forwarding work on localhost
                iptables -t nat -I OUTPUT --source 127.0.0.1 --destination 127.0.0.1 -p tcp --dport 80 -j REDIRECT --to-ports 5000





                share|improve this answer













                firewall-cmd --add-service=http --permanent
                firewall-cmd --add-service=https --permanent
                firewall-cmd --add-masquerade --permanent
                firewall-cmd --add-forward-port=port=80:proto=tcp:toport=5000 --permanent

                #make port forwarding work on localhost
                iptables -t nat -I OUTPUT --source 127.0.0.1 --destination 127.0.0.1 -p tcp --dport 80 -j REDIRECT --to-ports 5000






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 11 '17 at 6:18









                Marius AndreianaMarius Andreiana

                1062




                1062



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f364333%2fredirect-web-server-from-port-5000-to-port-80-on-localhost-fedora-firewall-cmd%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

                    Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

                    NetworkManager fails with “Could not find source connection”Trouble connecting to VPN using network-manager, while command line worksHow can I be notified about state changes to a VPN adapterBacktrack 5 R3 - Refuses to connect to VPNFeed all traffic through OpenVPN for a specific network namespace onlyRun daemon on startup in Debian once openvpn connection establishedpfsense tcp connection between openvpn and lan is brokenInternet connection problem with web browsers onlyWhy does NetworkManager explicitly support tun/tap devices?Browser issues with VPNTwo IP addresses assigned to the same network card - OpenVPN issues?Cannot connect to WiFi with nmcli, although secrets are provided