Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
06-03-2009, 09:17 AM
|
#1
|
|
LQ Newbie
Registered: Jun 2009
Posts: 2
Rep:
|
Difference between iptables and /sbin/route
What is the difference between iptables and /sbin/route?
Which one is used for what purpose?
I see that both can be used to block an IP from reaching your host.
Thanks
|
|
|
|
06-03-2009, 09:43 AM
|
#2
|
|
Member
Registered: Jul 2003
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Debian, FreeBSD
Posts: 94
Rep:
|
From man pages...
Quote:
|
iptables - administration tool for IPv4 packet filtering and NAT
|
Quote:
|
route - show / manipulate the IP routing table
|
iptables, basically is a firewall, it filters the packets routed through a box, or the packets to/from a box
route, manages the routings to/from network/hosts
Only iptables is used to block IPs.
For more...
Quote:
$ man iptables
$ man route
|
|
|
|
|
06-04-2009, 10:13 AM
|
#3
|
|
LQ Newbie
Registered: Jun 2009
Posts: 2
Original Poster
Rep:
|
I read somewhere that you can block an IP using -
If you are being attacked or abused by a particular host, just enter the following command to deny all access to the host:
/sbin/route add -host <ip address> reject
Replace with the IP address of the host you want to block. The address will stay blocked until you bounce the interface. Alternatively, you could allow access by:
/sbin/route del -host <ip address> reject
Hence I'm still confused if I could route to block IP address or not.
It did block the IP i wanted to block...but not sure if it is as secure as iptables.
|
|
|
|
06-04-2009, 12:43 PM
|
#4
|
|
Member
Registered: Aug 2003
Location: Seattle
Distribution: ubuntu, lately
Posts: 182
Rep:
|
you can use either. route reject is more esoteric than iptables, but if it works for you then you can probably use it without worry.
I'm not sure what you mean exactly by "as secure". If you mean that you can use it with confidence that it will: 1) truly reject all packets from the given IP and 2) persist across other route table changes then it should be fine. If you're asking the general community which method is preferable, most will say iptables, as it's in wide use and is made for exactly these kinds of operations.
If you have more detailed security questions on the use of routing table rejects vs iptables, you might post them in the linux-security forum. From my observations, the linux-networking forum answers more the "how-to" of network security issues, the linux-security forum is better to answer the "why".
|
|
|
|
06-05-2009, 03:25 AM
|
#5
|
|
Member
Registered: Mar 2009
Posts: 245
Rep:
|
Quote:
Originally Posted by svittal
If you are being attacked or abused by a particular host, just enter the following command to deny all access to the host:
/sbin/route add -host <ip address> reject
|
That only blocks traffic from the IP address if RPF (reverse path filter) is enabled.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 03:05 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|