Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. Polecenie:
- 1)iptables -t filter -L -v
- Chain INPUT (policy ACCEPT 40 packets, 5258 bytes)
- pkts bytes target prot opt in out source destination
- Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
- pkts bytes target prot opt in out source destination
- Chain OUTPUT (policy ACCEPT 43 packets, 2874 bytes)
- pkts bytes target prot opt in out source destination
- 2)iptables -t nat -L -v
- Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
- pkts bytes target prot opt in out source destination
- Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
- pkts bytes target prot opt in out source destination
- Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
- pkts bytes target prot opt in out source destination
- Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
- pkts bytes target prot opt in out source destination
- 3)iptables -t mangle -L -v
- Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
- pkts bytes target prot opt in out source destination
- Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
- pkts bytes target prot opt in out source destination
- Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
- pkts bytes target prot opt in out source destination
- Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
- pkts bytes target prot opt in out source destination
- Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
- pkts bytes target prot opt in out source destination
- 4)iptables -t raw -L -v
- Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
- pkts bytes target prot opt in out source destination
- Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
- pkts bytes target prot opt in out source destination
- 5) iptables -t security -L -v
- Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
- pkts bytes target prot opt in out source destination
- Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
- pkts bytes target prot opt in out source destination
- Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
- pkts bytes target prot opt in out source destination
- 2. Pokolei:
- 1) iptables -t filter -F
- 2) iptables -t nat -F
- 3) iptables -t mangle -F
- 4) iptables -t raw -F
- 5) iptables -t security -F
- 3. iptables -A INPUT -i eth0 -j DROP
- iptables -A INPUT -i lo -j ACCEPT
- 4. iptables -R 2 INPUT -i lo -j DROP
- 5. iptables -F INPUT
- 6. Plik firewall.sh
- #!/bin/bash
- echo 'Ad a'
- iptables -F
- iptables -X
- echo 'Ad b.'
- iptables -P INPUT DROP
- iptables -P FORWARD DROP
- iptables -P OUTPUT ACCEPT
- iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
- iptables -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
- echo 'Ad. c'
- iptables -A INPUT -i lo -j ACCEPT
- echo 'Ad d.'
- echo 'Ad e.'
- iptables -A INPUT -s ii.uwb.edu.pl -j DROP
- iptables -A OUTPUT -d ii.uwb.edu.pl -j DROP
- echo 'Ad.f'
- iptables -A FORWARD -d 192.168.1.253 -m multiport -p tcp --dports 23,22,80,110,443,8080 -j ACCEPT
- 7. iptables -t filter -F
Advertisement
Add Comment
Please, Sign In to add comment