Red Hat NETSCAPE MANAGEMENT SYSTEM 6.0 - COMMAND-LINE Instrukcja Użytkownika Strona 29

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 60
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 28
29
MySQL
iptables -A INPUT -p tcp -m tcp --dport 3306 –j ACCEPT
The very last rule we will put in is to drop all remaining packets that
didn’t match any of our rules. This is simply good practice:
iptables –A INPUT –j DROP
Finally, save your revised rules to a file, restart iptables and then verify
your rules are all in place:
service iptables save
service iptables restart
iptables -L
Other Useful
iptables
Commands
See the full ruleset file:
less /etc/sysconfig/iptables
Print out the current iptables with corresponding chain numbers
(needed to manipulate and insert lines):
iptables -L --line
NOTE: When you print out the current ruleset you may notice
that the first line may appear to allow anything from anywhere.
To see what it truly is, you’ll want to look at the actual file in
/etc/sysconfig/iptables
To insert a rule into a specific position, use:
iptables –I INPUT chain-number new-rule
To replace a specific rule, use:
iptables –R INPUT chain-number new-rule
To add a line at the end of the rule set, use:
iptables –A INPUT new-rule
For multiple, sequential ports, use the : symbol, such as:
iptables –A INPUT –p tcp –m tcp --dport 11000:11099
For multiple, non-sequential ports, use multiport, such as:
iptables –A INPUT –p tcp –m multiport --dport 80,443,8080
To check what rules are being used, you can view the Byte and Packet
counters:
iptables – vL
To clear (zero-out) the counters:
iptables -Z
To conduct port redirection – example is port 80 to port 8080:
iptables –t nat –A PREROUTING –p tcp --dport 80 –j REDIRECT --
to-port 8080
To conduct port redirection for local requests on the box – same
example:
iptables –t nat –A OUTPUT –d 127.0.0.1 –p tcp --dport 80 –j
REDIRECT --to-port 8080
Przeglądanie stron 28
1 2 ... 24 25 26 27 28 29 30 31 32 33 34 ... 59 60

Komentarze do niniejszej Instrukcji

Brak uwag