Search for:

Available article translations:

When mail is sent from my server, QMail uses an incorrect IP for the connection. How do I change the IP used for outgoing connections from my server?

Article ID: 1190, created on Oct 6, 2008, last review on Nov 29, 2014

  • Parallels Plesk for Linux/Unix


I would like to configure an IP address used by QMail for outgoing connections from my server.


The default IP for outgoing connections can be set using the "ip" utility. First, check how routing is configured on the server:

# /sbin/ip route dev eth1 proto kernel scope link src dev eth1 scope link
 default via dev eth1

If no "src" is listed in the "ip" output for the default route, the main IP on the interface is used for outgoing connections. You can change it using the following command:

# /sbin/ip route change default via dev eth1 src


# /sbin/ip route dev eth1 proto kernel scope link src dev eth1 scope link
 default via dev eth1 src

Note: Be careful. If you set the wrong IP as the source, you will lose the link to the server.

Additional Information

To preserve this result after reboot:

  • CentOS and RedHat OS'es:

    Route configuration can be stored per-interface in a /etc/sysconfig/network-scripts/route-interface file. For example, static routes for the eth0 interface would be stored in the /etc/sysconfig/network-scripts/route-eth0 file. The route-interface file has two formats: ip command arguments and network/netmask directives. See the ip-route(8) man page for more information on the ip route command

  • SuSE Linux:

    Insert the following lines into the /etc/sysconfig/network/if-up.d/staticroute file:

    /sbin/ip route change default via dev eth1 src
    /sbin/ip route change dev eth1 src

Search words:

source routing

qmail outgoing ip

9f8baf78266b4e54525d1c6bf06305a5 c81e59b61af9dca603ba03b14aabe968 56797cefb1efc9130f7c48a7d1db0f0c

Was this article helpful?
Tell us how we may improve it.
Yes No
Server Virtualization
- Parallels Cloud Server
- Parallels Containers for Windows 6.0
- Parallels Virtuozzo Containers
- Parallels Automation
- Parallels Automation for Cloud Infrastructure
- Parallels Business Automation Standard
- Parallels Virtual Automation
- Parallels Plesk Panel Suite
- Web Presence Builder
- Parallels Plesk Automation
- Parallels Small Business Panel
- Value-added Services for Hosters
- Parallels Partner Storefront
Services & Resources
- Cloud Acceleration Services
- Professional Services
- Support Services
- Training & Certification