Friday, July 3, 2020

How to open port 5000 for use by Node JS Application

How to open port 5000 for use by Node JS Application
Reference: https://www.cyberciti.biz/faq/howto-rhel-linux-open-port-using-iptables/

[root@thermalite ~]# firewall-cmd --list-ports
9000/tcp 9001/tcp 1433/tcp 8080/tcp

[root@thermalite ~]# firewall-cmd --get-zones
block dmz drop external home internal libvirt public trusted work

[root@thermalite ~]# ip a
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp2s0: mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 90:2b:34:38:27:51 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.100/24 brd 192.168.1.255 scope global noprefixroute enp2s0
       valid_lft forever preferred_lft forever
    inet6 fe80::3033:b8ea:8652:3d3/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
3: virbr0: mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:41:41:60 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
4: virbr0-nic: mtu 1500 qdisc fq_codel master virbr0 state DOWN group default qlen 1000
    link/ether 52:54:00:41:41:60 brd ff:ff:ff:ff:ff:ff
5: docker0: mtu 1500 qdisc noqueue state DOWN group default
    link/ether 02:42:82:0e:78:5f brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:82ff:fe0e:785f/64 scope link
       valid_lft forever preferred_lft forever

[root@thermalite ~]# firewall-cmd --get-zone-of-interface=enp2s0
public

[root@thermalite ~]# firewall-cmd --permanent --add-port 5000/tcp
success

[root@thermalite ~]# firewall-cmd --list-ports
9000/tcp 9001/tcp 1433/tcp 8080/tcp

[root@thermalite ~]# systemctl restart firewalld

[root@thermalite ~]# firewall-cmd --list-ports
9000/tcp 9001/tcp 1433/tcp 8080/tcp 5000/tcp
[root@thermalite ~]#

No comments:

Post a Comment