LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-01-2006, 08:53 AM   #1
SirTristan
Member
 
Registered: Feb 2006
Distribution: GNU/Linux
Posts: 54

Rep: Reputation: 15
Routing requests from the server, thru an IP other than the Main


Is there any way to change the IP address/port that a request from my server comes from?

By default requests originate from the Main Shared IP. Is there any way to channel specific requests (e.g., from a PHP script or ping) through other IP addresses that are already pointed to the server?
 
Old 12-02-2006, 11:50 AM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 62
Do you mean hide your true IP or use a fake IP?

Brian
 
Old 12-03-2006, 12:08 AM   #3
SirTristan
Member
 
Registered: Feb 2006
Distribution: GNU/Linux
Posts: 54

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Brian1
Do you mean hide your true IP or use a fake IP?

Brian
I mean use an IP that is your true IP, in the sense that the IP is pointed to your server (and one of your sites may be on it), but it is not the main shared IP.

e.g., a server has 8 IP addresses; but all requests from the server originate from the main shared IP only. How does one funnel requests through one of the other IPs?
 
Old 12-03-2006, 09:24 AM   #4
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
Quote:
Originally Posted by SirTristan
e.g., a server has 8 IP addresses; but all requests from the server originate from the main shared IP only. How does one funnel requests through one of the other IPs?
Modify the routing table for the network/subnetmask you want to allow this, with src main-shared-IP

e.g.
I've two ips at my box, 172.16.16.16 & 172.16.16.17 but i want that outgoing requests originating from my box goes out with 172.16.16.17(even being secondary ip), then with
Code:
ip rou ch/add network/mask dev eth0  proto kernel  scope link  src 172.16.16.17
You got to delete the previous route with src <previou-ip> to bring this in effect.
Do a ip rou flush cache as well.
 
Old 12-08-2006, 08:36 AM   #5
SirTristan
Member
 
Registered: Feb 2006
Distribution: GNU/Linux
Posts: 54

Original Poster
Rep: Reputation: 15
Thank you very much for tht Amit, that is the type of thing I'm looking for. I appreciate that info.

I got around to trying it but am getting an error, Command "ch/add" is unknown, try "ip route help".

I'm not familiar with these commands so I don't want to experiment for fear of knocking out my server. Anyone know what exactly I should be entering into the command line (other than the exact IP of course)? My fear is that I'll mess up the server.

Also, I don't suppose there is any automated way to do this? (e.g., in PHP/Perl on a per-script basis) Seems like there most likely isn't. (though I wonder if passthru() would work in PHP...)
 
  


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
Lots of nonsense requests for twiki server Zilvermeeuw Linux - Security 3 10-19-2006 01:25 PM
Allow page requests from a given server txtoolman Linux - Software 5 06-21-2006 09:55 PM
Can't get my http server to respond to requests... garydamm Linux - Networking 9 01-16-2005 11:00 AM
Server refusing SMTP connection requests Lunch Linux - Networking 3 03-16-2004 10:06 AM
changing non-main routing tables ? laclac01 Linux - Networking 1 02-20-2004 10:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:25 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration