Forwarding Ports on Centos 7

35,833

I just found a way that made this possible for me:

firewall-cmd --zone=public --add-masquerade --permanent
firewall-cmd --zone=public --add-forward-port=port=443:proto=tcp:toport=3001 --permanent
Share:
35,833

Related videos on Youtube

zzzsys
Author by

zzzsys

Updated on September 18, 2022

Comments

  • zzzsys
    zzzsys almost 2 years

    I'm working on a CentOS 7 server and I'm trying to get JBoss to work the way I want it too. I'm running Java 8 and JBoss(wildly) 8. I have gotten those installed and working on the default ports, but I want to get JBoss to work on port 80. I know I can get it to work on port 80 if I run it as root, but I know that isn't a good idea and I don't want to run it as root any way.

    I have tried forwarding port 80 to 8080, but I haven't gotten it to work. I think I'm missing a step, but I don't know what I'm missing.

    I'm using firewall-cmd. I have opened up both ports (80 & 8080) and I have enable masquerading for public zone. I have also used this command to forward the port

    firewall-cmd --zone=public --add-forward-port=port=80:proto=tcp:toport=8080.  
    

    Any idea what I'm missing?

    • Michael Hampton
      Michael Hampton over 9 years
      What's wrong with running httpd or nginx in front of it?
    • zzzsys
      zzzsys over 9 years
      Nothing, I was trying to not do it that way if I could help it.
  • zzzsys
    zzzsys over 9 years
    Thank you, I will check that out. The connection is from an external source.
  • Guru
    Guru over 7 years
    correct +1 for you. I had to do lot of struggle to get here.
  • Steve Yakovenko
    Steve Yakovenko about 5 years
    FirewallD is not running
  • just_user
    just_user about 5 years
    @SteveYakovenko then starting it is a good first step.