Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- > W tabeli filter utwórz nowy łańcuch, który dodaj jako cel do łańcucha INPUT (z tabeli filter)
- - sudo iptables -N myChain
- - sudo iptables -A INPUT -j myChain
- - sudo iptables -L
- W utworzonym łańcuchu dodaj reguły:
- > akceptowane były połączenia z lokalnej maszyny
- sudo iptables -A myChain -s 127.0.0.0/8 -j ACCEPT
- > akceptowane były połączenia z zainstalowanymi usługami
- - sudo iptables -A myChain -p tcp --dport ssh -j ACCEPT
- - sudo iptables -A myChain -p tcp --dport http -j ACCEPT
- - sudo iptables -A myChain -p tcp --dport https -j ACCEPT
- - sudo iptables -A myChain -p tcp --dport 53 -j ACCEPT
- - sudo iptables -A myChain -p tcp --dport 25 -j ACCEPT
- - sudo iptables -L myChain
- > pakiety ICMP przychodzące z komputera 158.75.112.120 były odrzucane z wysyłaniem informacji o niedostępności maszyny
- - sudo iptables -A myChain -s 158.75.112.120 -p icmp -j REJECT
- sudo iptables -A myChain -s 10.0.2.5 -p icmp -j REJECT
- > akceptowane były pozostałe pakiety ICMP z sieci 158.75.112.0/24, 158.75.12.0/24, 192.168.132.0/24 i 192.168.128.0/24
- - sudo iptables -A myChain -s 158.75.112.0/24 -p icmp -j ACCEPT
- - sudo iptables -A myChain -s 158.75.12.0/24 -p icmp -j ACCEPT
- - sudo iptables -A myChain -s 192.168.132.0/24 -p icmp -j ACCEPT
- - sudo iptables -A myChain -s 192.168.128.0/24 -p icmp -j ACCEPT
- > odrzucane były pozostałe pakiety
- - sudo iptables -P INPUT DROP%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement