Bash/Port

From Chorke Wiki
Revision as of 22:46, 10 June 2018 by Shahed (talk | contribs) (Created page with "Using <code>fuser</code> <syntaxhighlight lang="bash"> # check 22210 port is running fuser 22210/tcp # 22210/tcp: 4981 # check 55510 port is running fuser 55510/tc...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Using fuser

# check 22210 port is running
fuser 22210/tcp
# 22210/tcp:            4981

# check 55510 port is running
fuser 55510/tcp
# 55510/tcp:            5062

Using lsof

# check 22210 port is running
lsof -i TCP:22210
# COMMAND  PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
# java    4981 chorke  280u  IPv6  37810      0t0  TCP *:22210 (LISTEN)

# check 55510 port is running
lsof -i TCP:55510
# COMMAND  PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
# java    5062 chorke  280u  IPv6  37810      0t0  TCP *:55510 (LISTEN)

Specific Port Enable

firewall-cmd --zone=public --permanent --add-port=11100/tcp
firewall-cmd --zone=public --permanent --add-port=1521/tcp
firewall-cmd --zone=public --permanent --add-port=3306/tcp
firewall-cmd --zone=public --permanent --add-port=5432/tcp
firewall-cmd --reload
netstat

Range of Port Enable

firewall-cmd --zone=public --permanent --add-port=22200-22290/tcp
firewall-cmd --zone=public --permanent --add-port=55500-55590/tcp
firewall-cmd --zone=public --permanent --add-port=11110-11119/tcp
firewall-cmd --reload
netstat

References