加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – 来自不同站点的不同外部IP地址

发布时间:2020-12-14 02:46:46 所属栏目:Linux 来源:网络整理
导读:我的路由器是 ClearOS 6(Centos 6).在我的路由器中,我有来自两个ISP的两个外部(互联网)网络连接. 主要连接是eth2连接到电缆调制解调器,第二个连接是ppp0连接到dsl调制解调器.我已将eth2指定为主要连接(具有高度量值).事实上,这是通过clearos的multiwan web界
我的路由器是 ClearOS 6(Centos 6).在我的路由器中,我有来自两个ISP的两个外部(互联网)网络连接.

主要连接是eth2连接到电缆调制解调器,第二个连接是ppp0连接到dsl调制解调器.我已将eth2指定为主要连接(具有高度量值).事实上,这是通过clearos的multiwan web界面完成的.我在Nagios中进行了测试,以监控主要连接是否存在.此连接基于结果完成

curl ifconfig.me

但似乎ifconfig.me总是提供我的辅助连接的IP地址.我通过浏览器测试了它.是ifconfig.me给出了二级互联网的(ppp0)IP地址.但是whatismyipaddress.[com | org]给出我的主要IP地址(eth2).我检查了路由器上的默认路由

ip route list 0/0

<二级网络> dev ppp0 proto kernel scope link src< secondary ip address>
<主要网络> dev eth2 proto kernel scope link src< primary ip address>
<兰> dev eth0 proto kernel scope link src< lan interface address>
默认通过<主要网关地址> dev eth2

它还显示主连接(eth2)作为默认路由.

traceroute www.google.com

traceroute ifconfig.me

两者似乎都通过主要连接(eth2)进行追踪.

由于我们的二级互联网连接只有有限的下载,我不想最终在月底支付大笔款项.

有人知道为什么ifconfig.me会显示我的辅助地址吗?

确保我的路由器(以及局域网)使用正确的互联网连接的最佳方法是什么.

解决方法

一眼就看起来你的路线配置正确.

我建议你使用Wireshark / T-Shark分别查看离开每个外部接口(eth2,ppp0)的数据包,看看运行curl ifconfig.me命令时会发生什么.这可能会为您提供一个线索,说明为什么您使用不同的工具获得不同的结果.

您是否尝试过其他IP地址查找tools以查看是否获得相同的结果?同样,这可能具有启发性.

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

但听起来你真正想要的是故障转移而不是负载平衡.也就是说,您希望所有流量都离开主要连接,而次要连接只是存在,以防主要连接发生故障.

从ClearOS documentation开始:

Multi-WAN weights are used to load balance outbound Internet traffic.
By default,all WAN interfaces are given a weight of one. This default
configuration means the network traffic will be roughly evenly split
amongst the different WAN connections.

In one of the typical multi-WAN configurations,a second broadband connection is used for backup. This second connection is often a low-cost and low-bandwidth connection. In this case,you would want to set the weight on your high-bandwidth connection to 3 or 4,while leaving your low-cost/low-end connection with a weight of 1.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读