You want to prevent outgoing access to a network, e.g., all web servers at yahoo.com.
Figure out how to specify the yahoo.com network, e.g., 64.58.76.0/24, and reject web access:
For iptables:
# iptables -A OUTPUT -p tcp -d 64.58.76.0/24 --dport www -j REJECT
For ipchains:
# ipchains -A output -p tcp -d 64.58.76.0/24 --dport www -j REJECT
Here the network is specified using Classless InterDomain Routing (CIDR) mask format, a.b.c.d/N, where N is the number of bits in the netmask. In this case, N=24, so the first 24 bits are the network portion of the address.
iptables(8), ipchains(8).
|
![]() | Linux security |