Home > OS >  Who will control the tun0 cenos7.5 server nic
Who will control the tun0 cenos7.5 server nic

Time:10-19

Such as access 166.436.676.464 is prohibited

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 blocked

CodePudding 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:

hostdeny

CodePudding user response:

reference 5 floor holeblack reply:
hostdeny

How to ban tun0 access 182.254.116.117

CodePudding user response:

reference 5 floor holeblack reply:
hostdeny

Or the port number, can give a instance
  • Related