Bash/Network: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
(Created page with "<syntaxhighlight lang="bash"> # 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 i...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 11: Line 11:
# to turn on  eth0 interface
# to turn on  eth0 interface
ifup eth0
ifup eth0
</syntaxhighlight>
'''Specific Port Enable'''
<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
netstat
</syntaxhighlight>
'''Range of Port Enable'''
<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]

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