CodePudding user response:
Change 192.168.1.12 to blockade IP you want, tun0 change you want to name card can
//the nic tun0 banned source for 192.168.1.12 package
The iptables -i INPUT -s 192.168.1.12 -i tun0 -j DROP
Check set strategy
[root] # iptables nvL - line - number
/root @ H3C ~ # iptables nvL - line - number
Chain INPUT (policy DROP 2 packets, 104 bytes)
Num PKTS bytes target prot opt out in the source destination
1 0 0 DROP all - tun0 * 192.168.1.12 0.0.0.0/0 id: 0
2 k m ACCEPT all 38 400 - * * 0.0.0.0/0 0.0.0.0/0 id: 0 state RELATED, ESTABLISHED
Delete rules
Iptables - D INPUT 1 (the figure is num column corresponding rule)
CodePudding user response:
Is that forbidden access, will not be blockedCodePudding user response:
Wrong, then use the following command - d specify destination address - o nic
Iptables -i 192.168.1.2 instead of the OUTPUT - d - o tun0 -j DROP
CodePudding user response:
hostdenyCodePudding user response: