Bash/Network: Difference between revisions
Jump to navigation
Jump to search
m (Shahed moved page Network to Bash/Network: Maintain Hierarchy of Script) |
No edit summary |
||
Line 11: | Line 11: | ||
# to turn on eth0 interface | # to turn on eth0 interface | ||
ifup eth0 | ifup eth0 | ||
</syntaxhighlight> | |||
'''Specific Port''' | |||
<syntaxhighlight lang="bash"> | |||
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 | |||
nmap -sT -O localhost | |||
netstat | |||
</syntaxhighlight> | |||
'''Range of Port''' | |||
<syntaxhighlight lang="bash"> | |||
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 | |||
</syntaxhighlight> | </syntaxhighlight> | ||
== References == | == References == | ||
* [https://www.cyberciti.biz/faq/linux-restart-network-interface/ Restart Network Interface Using Bash] | * [https://www.cyberciti.biz/faq/linux-restart-network-interface/ Restart Network Interface Using Bash] |
Revision as of 00:54, 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
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
nmap -sT -O localhost
netstat
Range of Port
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