Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaofengWu123 committed Apr 25, 2023
1 parent 5db6bbf commit e8f17c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions _pages/08-linux-iptables.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ sfwu22@proj88:~$ sudo iptables -t nat -nvL --line-number
## Add/Insert Rules
```console
# add rules to the end of a table
sfwu22@proj88:~$ sudo iptables -nvL --line-number
sfwu22@proj88:~$ sudo iptables -A INPUT -s 100.100.100.0/24 -j ACCEPT
...
# insert rule into a table
sfwu22@proj88:~$ sudo iptables -t nat -nvL --line-number
sfwu22@proj88:~$ sudo iptables -I INPUT 2 -s 100.100.100.0/24 -j ACCEPT
```

## Delete Rules
```console
# delete rule number 1 from INPUT chain
sfwu22@proj88:~$ sudo iptables -D FORWARD 1
sfwu22@proj88:~$ sudo iptables -D INPUT 1

# delete rule number 1 from nat table POSTROUTING chain
sfwu22@proj88:~$ sudo iptables -t nat -D POSTROUTING 1
Expand Down

0 comments on commit e8f17c8

Please sign in to comment.