Solved

IP Route modification

Posted on 2009-04-02
3
371 Views
Last Modified: 2013-12-27
We use qmail on our server. We wanted to change the outgoing IP for qmail. We read a solution to this where you change the default IP address of outgoing connections. This was accomplished by using the following command:

# /sbin/ip route change default via ***.***.***.*** dev eth0 src yyy.yyy.yyy.yyy.

Upon restarting qmail, this fixed our problem; outgoing mail showed the correct IP address. However, upon server reboot, it restores to the initial configuration. Any idea why and how to prevent it from restoring to the default? Any feedback is greatly appreciated.

Thank you,
Adam
0
Comment
Question by:ajschw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 78

Assisted Solution

by:arnold
arnold earned 100 total points
ID: 24057020
Check www.qmail.org I think there is a patch that adds functionality to bind the a qmail process that deals with outgoing emails to a specific IP.

The other option is to configure your server to the new IP.

I.e. make the change permananet modify the /etc/hosts file to reflect the updated IP for the system/ or /etc/networking-scripts.
Or better still use the network configuration scripts to set the IP of the system permanently.
0
 
LVL 34

Assisted Solution

by:Duncan Roe
Duncan Roe earned 150 total points
ID: 24058508
As a quick and dirty fix you could include your ip route command in /etc/rc.d/rc.local (location varies with distribution but they all have a local facility somewhere). That's like re-entering te command after every reboot. Invoke ip by full pathname (i.e. /sbin/ip)
0
 
LVL 32

Accepted Solution

by:
Kamran Arshad earned 250 total points
ID: 24074537
Hi,

After rebooting the routes were not added persistently. To make the route change persistently;

http://www.itsyourip.com/Linux/howto-add-a-persistent-static-route-in-redhat-enterprise-linux/
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question