본문 바로가기

nftables

Port Knocking 활용 source1: https://wiki.nftables.org/wiki-nftables/index.php/Port_knocking_example source2: http://choesin.com/linux%EC%97%90%EC%84%9C-%ED%8F%AC%ED%8A%B8-%EB%85%B8%ED%82%B9%EC%9D%84-%EC%82%AC%EC%9A%A9%ED%95%98%EB%8A%94-%EB%B0%A9%EB%B2%95-%EB%B0%8F-%EC%82%AC%EC%9A%A9%ED%95%98%EC%A7%80-%EC%95%8A%EC%95%84 이전 글: nftables examples 포트 노킹은 비밀 노크를 말합니다. 특정한 port sequence를 입력하면 출입을 허용하거나 닫는 것을 말합니다. 그런데 po.. 더보기
nftables examples source: https://wiki.nftables.org/wiki-nftables/index.php/Main_Page 의 Examples 이전 글: nftables 이란 / netfilter.org nftables project 다음 글: Port Knocking 활용 목차 Simple ruleset for a workstation Simple ruleset for a server Simple Ruleset for a Router Basic routing firewall Basic NAT Typical workstation (separate IPv4 and IPv6) Stateful router example Bridge Filtering Multiple NATs using nftables maps .. 더보기
Output text modifier source: https://wiki.nftables.org/wiki-nftables/index.php/Output_text_modifiers 이전 글: 룰셋 Ruleset debug/tracing 다음 글: nftables examples https://wiki.nftables.org/wiki-nftables/index.php/Output_text_modifiers 여기에 나타난 modifier와 필자의 Ubuntu 시스템에서 이용할 수 있는 modifier가 다릅니다. salsal@r3:~$ lsb_release -d Description:Ubuntu 18.04.5 LTS salsal@r3:~$ sudo apt policy nftables nftables: Installed: 0.8.2-1 Candi.. 더보기
룰셋 Ruleset debug/tracing source: https://wiki.nftables.org/wiki-nftables/index.php/Ruleset_debug/tracing 이전 글: Scripting 다음 글: Output text modifier debug/tracing은 nftabels 0.6, linux kernel 4.6 부터 지원합니다. 최근에 설치한 Ubuntu 18.04에 설치한 nftables과 kernel version은 아래와 같습니다. - nftables: 0.8.2-1 - Linux: 5.4.0-80 iptables에서 -j TRACE와 같은 것이며, 더 향상된 기능이 있습니다. 패켓에 대한 tracing을 하려면, 절차는 trace 목적의 chain을 만들어 hook 에 base chain으로 등록한 후, 해.. 더보기
Scripting source: https://wiki.nftables.org/wiki-nftables/index.php/Scripting 이전 글: 룰셋 갱신 지켜보기 / Monitoring ruleset updates 다음 글: 룰셋 Ruleset debug/tracing 많은 사람들이 ruleset을 shell script 안에 저장하고 관리하기를 원합니다. 설명하는 글을 남겨 놓거나, 보기 편하기 때문입니다. 그러나 Shell Script는 순식간에 많은 룰 변경 / Atomic rule replacement에서 설명한 Atomicity를 방해합니다. nftables은 scripting과 atomicity 둘 다를 만족시킬 수 있는 script 환경을 제공합니다. rule을 담은 파일을 읽어 들이면 됩니다. % n.. 더보기
룰셋 갱신 지켜보기 / Monitoring ruleset updates source: https://wiki.nftables.org/wiki-nftables/index.php/Monitoring_ruleset_updates 이전 글: 다음 글: nft monitor를 이용하여 ruleset의 변화를 지켜볼 수 있습니다. % nft monitor # 새로운 rule을 생성되는 것을 보고 싶으면 % nft monitor new rules 다음은 Terminal 1에서 nft monitor를 입력하고 다른 Terminal 2에서 rule을 추가하면서 Terminal 1의 출력을 보인 것입니다. Terminal 1 에서 보기 명령어를 입력합니다. salsal@r3:~$ sudo nft monitor Terminal 2 에서 rule을 추가합니다. salsal@r3:~$ sudo n.. 더보기
룰셋 레벨 명령 / Operations at ruleset level source: https://wiki.nftables.org/wiki-nftables/index.php/Operations_at_ruleset_level 이전 글: 룰 표현 / Building rules through expressions 다음 글: 룰셋 갱신 지켜보기 / Monitoring ruleset updates nft native 문법 목록 확인 salsal@r3:~$ sudo nft list ruleset table ip filter { chain output { type filter hook output priority 0; policy accept; ip daddr 7.7.7.7 counter packets 0 bytes 0 ip daddr 6.6.6.6 counter packets 0 b.. 더보기
룰 표현 / Building rules through expressions source: https://wiki.nftables.org/wiki-nftables/index.php/Building_rules_through_expressions 이전 글: 명령어에서 오류 출력 다음 글: Operations at ruleset level nftables은 다음과 같은 표현을 제공합니다. 표현 의미 기호 의미 eq eqaul == 같은 ne not equal != 같지 않은 lt less than 큰 le less than and equal = 크거나 같은 주의할 사항은 shell에서 를 사용하면 입출력 redirection으로 오해할 수 있으니 \ 를 이용해야 합니다. 아래 룰은 TCP/22가 아닌 경우를 명시한 것입니다. nft add rule filter input tcp dpo.. 더보기