Link to home
Start Free TrialLog in
Avatar of bryanlloydharris
bryanlloydharris

asked on

linux routing question

At my job we have a script which will block traffic from an IP address.  For example, for an IP address = A.B.C.D the script would execute this command:

/sbin/route add -net A.B.C.0 netmask 255.255.255.0 lo

Can anybody explain how this works?  I have been tring to understand why this should block the traffic from the IP but I don't understand.

We are using Redhat linux version 7.2.  If the server's gateway were 1.1.1.1 then this would be the routing table:
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
1.1.1.0     0.0.0.0         255.255.240.0   U         0 0          0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
0.0.0.0         1.1.1.1     0.0.0.0         UG        0 0          0 eth0
ASKER CERTIFIED SOLUTION
Avatar of Gabriel Orozco
Gabriel Orozco
Flag of Mexico image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bryanlloydharris
bryanlloydharris

ASKER

Thanks!