본문 바로가기

nftables

명령어에서 오류 출력

source: https://wiki.nftables.org/wiki-nftables/index.php/Error_reporting_from_the_command_line

이전 글: 순식간에 많은 룰 변경 / Atomic rule replacement

다음 글: 룰 표현 / Building rules through expressions

 

nft 명령어를 입력하다가 문법이 틀리거나 parameter나 값을 제대로 입력하지 않으면 오류 메시지를 출력해 줍니다. 

 

아래는 존재하지 않는 테이블 (filter) 을 지정했을 때 오류 메시지를 ^^^^^^^^^ 으로 알려줍니다. 

salsal@r3:~$ sudo nft list chain filter output
Error: Could not process rule: Table 'filter' does not exist
list chain filter output
^^^^^^^^^^^^^^^^^^^^^^^^^

아래는 명령어는 filter 뒤에 chain-name을 명시했어야 하는데 하지 않아 오류 메시지를 ^^^^^^^^^ 으로 알려줍니다. 

salsal@r3:~$ sudo nft list chain filter
Error: syntax error, unexpected newline, expecting string
list chain filter
                 ^
salsal@r3:~$

아래 명령어는 dport 뒤에 정수나 keyword를 넣어줘야 하는데 그렇지 않아 발생한 오류입니다. 

salsal@r3:~$ sudo nft add rule filter input tcp dport 1.1.1.1 counter drop
Error: Could not resolve service: Servname not found in nft services list
add rule filter input tcp dport 1.1.1.1 counter drop
                                ^^^^^^^

아래 명령어는 dport 뒤에 값을 지정해 줘야 하는데 그렇지 않아 발생한 오류입니다.

salsal@r3:~$ sudo nft add rule filter input tcp dport
Error: syntax error, unexpected newline
add rule filter input tcp dport
                               ^
salsal@r3:~$

 

이전 글: 순식간에 많은 룰 변경 / Atomic rule replacement

다음 글: 룰 표현 / Building rules through expressions