Hitachi CE50-10 Instruction Manual page 85

Table of Contents

Advertisement

Figure 5‒14: Procedure for setting the rules
Note
The rule settings are applied when the command is run.
For example, if you perform an operation to cancel the reception permission of the SSH port while an SSH
connection is being established, the ongoing communication may be disconnected and SSH login may be disabled.
(a) Setting the port permitted for reception
1. Run the following command to permit reception on a port with a given port number.
$ sudo iptables -A INPUT -p protocol: tcp|udp --dport port-number -j ACCEPT
Example: Specify as follows to permit reception on the HTTP server port (80/tcp):
$ sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
2. Run the following command to cancel the reception permission that has been set.
$ sudo iptables -D INPUT -p protocol:tcp|udp --dport port-number -j ACCEPT
Example: Specify as follows to cancel the reception permission for the HTTP server port (80/tcp).
$ sudo iptables -D INPUT -p tcp --dport 80 -j ACCEPT
(b) Setting the port permitted for transmission
1. Run the following command to connect to a port with a given number.
$ sudo iptables -A OUTPUT -p protocol:tcp|udp --dport port-number -j ACCEPT
Example: Specify as follows to permit transmission to the HTTP server port (80/tcp).
$ sudo iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT
2. Run the following command to cancel the transmission permission that has been set.
$ sudo iptables -D OUTPUT -p protocol:tcp|udp --dport port-number -j ACCEPT
Example: Specify as follows to cancel the transmission permission for the HTTP server port (80/tcp).
$ sudo iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT
5. Configuring Software Environment
69

Advertisement

Table of Contents
loading

Table of Contents