Bash/Network: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 13: Line 13:
</syntaxhighlight>
</syntaxhighlight>


'''Specific Port'''
'''Specific Port Enable'''
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
firewall-cmd --zone=public --permanent --add-port=11100/tcp
firewall-cmd --zone=public --permanent --add-port=11100/tcp
Line 20: Line 20:
firewall-cmd --zone=public --permanent --add-port=5432/tcp
firewall-cmd --zone=public --permanent --add-port=5432/tcp
firewall-cmd --reload
firewall-cmd --reload
nmap -sT -O localhost
netstat
netstat
</syntaxhighlight>
</syntaxhighlight>


'''Range of Port'''
'''Range of Port Enable'''
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
firewall-cmd --zone=public --permanent --add-port=22200-22290/tcp
firewall-cmd --zone=public --permanent --add-port=22200-22290/tcp

Latest revision as of 00:57, 8 May 2018

# show config all interface
ifconfig

# see ip add  eth0 interface
ip a show eth0

# to turn off eth0 interface
ifdown eth0

# to turn on  eth0 interface
ifup eth0

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