Different external ip addresses from different sites

Posted by user630286 on Server Fault See other posts from Server Fault or by user630286
Published on 2012-10-29T10:12:38Z Indexed on 2012/10/29 11:03 UTC
Read the original article Hit count: 249

Filed under:
|
|

My router is ClearOS 6(Centos 6). In my router, I have two external (internet) network connections from two ISP's.

The primary connection is eth2 connected to a cable modem and the second one is ppp0 connected to a dsl modem. I have assigned eth2 as the primary connection (with a high metric value). In fact this is done through clearos's multiwan web interface. I have a test in my Nagios to monitor whether the primary connection. This connection is done based on the result of

curl ifconfig.me

But it seems that ifconfig.me is always giving the ip address of my secondary connection. I tested it through a browser. Yes ifconfig.me gives the secondary internet's(ppp0) ip address. But whatismyipaddress.[com|org] give my primary ip address (eth2). I checked the default route on the router through

ip route list 0/0

which also shows the primary connection (eth2) as the default route.

The

traceroute www.google.com 

and

traceroute ifconfig.me 

both seems to trace through the primary connection (eth2).

As our secondary internet connection has only got a limited download, I don't want to end up having to pay a large sum at the end of the month.

Has somebody got an idea why the ifconfig.me shows my secondary address?

What is the best way to ensure that my router(and thus the lan) use the right internet connection.

© Server Fault or respective owner

Related posts about linux

Related posts about networking