Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I would like to disable my machine to reach a remote access and to block incoming traffic from the same network. so actually I need to block output traffic to network "X" and input traffic from network "x" but I want all other traffic to be open input and ouput

Thanks!

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

assuming you want to start with no other rules

iptables -F

iptables -X

iptables INPUT -p ACCEPT

iptables FORWARD -p ACCEPT

iptables OUTPUT -p ACCEPT

the rules you want:

iptables -I INPUT -s <ip> -j DROP

iptables -I OUTPUT -d <ip> -j DROP

then run

service iptables save

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.