LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 06-23-2010, 06:18 PM   #1
NoahJK
LQ Newbie
 
Registered: Mar 2010
Posts: 26

Rep: Reputation: 0
Linux route/routing table


Hello,

How to reroute/redirect traffic from IP of my 1st server to IP of my 2nd server via route/linux routing table?

I know how to do it via iptables but I need it to be done via route/routing table.

Thanks
regards
 
Old 06-23-2010, 06:27 PM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 163Reputation: 163
Why not use iptables out of curiosity? To do much of anything with the routing table you'll likely need iproute2.

Last edited by rweaver; 06-23-2010 at 06:28 PM.
 
Old 06-24-2010, 02:06 AM   #3
NoahJK
LQ Newbie
 
Registered: Mar 2010
Posts: 26

Original Poster
Rep: Reputation: 0
Because iptables is a software, route happens on the kernel level thus it's better.

Also,if I redirect my 1. server to my 2. server will I see the IP of 1. server connectiong to 2. server or my own IP?
 
Old 06-24-2010, 03:31 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
Please provide details describing the exact problem you're trying to solve. Why do you want to redirect all traffic intended for server1 to server2?

BTW, netfilter is also kernel level. Read the manpages for iptables(8).
 
Old 06-25-2010, 09:35 AM   #5
vishesh
Member
 
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661

Rep: Reputation: 66
iptables in just a userspace program , required changes are done in kernel itself so dont bother about that.

Thanks
 
Old 06-25-2010, 11:32 AM   #6
jork
LQ Newbie
 
Registered: Jun 2010
Location: beweth
Distribution: Ubuntu, RHEL, Monta Vista, QNX
Posts: 16

Rep: Reputation: 0
You can use the 'route add src_range gw' command to direct your traffic from src subnet to a gateway. check the man pages of route command for the correct syntax. But I don't think you can do the actual NATing with route. Is what you are intending to do?

Iptables also work in the kernel space itself, its just the interface works on the userspace. So I don't think you can get any performance advantage by using route.

-jork
 
Old 06-25-2010, 01:35 PM   #7
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by vishesh
iptables in just a userspace program , required changes are done in kernel itself so dont bother about that.
It's pointless to debate something so well documented. Please read the manpages for iptables(8).
 
Old 06-25-2010, 02:43 PM   #8
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 163Reputation: 163
Quote:
Originally Posted by NoahJK View Post
Because iptables is a software, route happens on the kernel level thus it's better.
Incorrect on so many levels. Shoe horning a software into doing something it wasn't really intended to do regardless of if it occurs natively in the kernel or through a module is less desirable even when possible. Both route and iptables have userspace interfaces... nee: /sbin/route & /sbin/iptables.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Default route deleted from the Fedora's routing table RedHatAddict Linux - Networking 11 09-28-2009 10:16 PM
How to route using my own custom routing tables and not the Kernel's table WhiskeyTangoFoxtrot Linux - Networking 1 03-17-2009 11:03 AM
Routing table problem - can't route over ppp link ocgltd Linux - Networking 1 01-12-2007 02:07 AM
Default route disappears from kernel routing table second after adding it eli_pack Linux - Networking 2 03-13-2006 04:39 AM
Does ftp have a routing table on where to route users? digital bots Linux - Networking 1 04-06-2004 06:26 PM


All times are GMT -5. The time now is 11:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration