dhclient正确后,AWS第二个弹性IP无法正常工作 [英] AWS second elastic IP not working after correct dhclient results

查看:203
本文介绍了dhclient正确后,AWS第二个弹性IP无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑:已解决,路由表未正确更新。

Solved, routing table did not update properly. as was answered.

在AWS和Ubuntu 16.04上,第二个网络接口连接了第二个弹性IP。

On AWS and Ubuntu 16.04, a 2nd network interface is attached with 2nd elastic IP.

实例详细信息显示2个私有IP,dhclient eth1 up可以正常工作。
ifconfig显示网络掩码,hwaddr并正确广播。
第一个IP和第二个IP使用相同的安全组,第一个IP起作用。

Instance details show 2 private IPs, dhclient eth1 up works properly. ifconfig shows netmask, hwaddr and broadcast correctly. 1st and 2nd IPs use the same security group, 1st IP works.

但是实例详细信息仅显示了1个公用/弹性IP,但我无法连接到第二个弹性IP。
调试方面的任何想法将不胜感激。

Yet instance details show only 1 public/elastic IP, and I can't connect to the second elastic IP. Any ideas on debugging this will be appreciated.

已通过以下命令修复:
ip route通过10.10.2.1添加默认值dev eth0选项卡1

Fixed by the following commands: ip route add default via 10.10.2.1 dev eth0 tab 1

ip路由通过10.10.2.1 dev eth1选项卡2添加默认值

ip route add default via 10.10.2.1 dev eth1 tab 2

从IP_1选项卡1添加IP规则

ip rule add from IP_1 tab 1

从IP_2标签2添加IP规则

ip rule add from IP_2 tab 2

推荐答案

这是因为您在同一子网上具有多个网络接口,因此您的操作系统不会将其发送出正确的接口。您需要在实例上使用基于源的路由才能完成这项工作。

This is because you have multiple network interfaces on the same subnet, so your OS is not sending it out of the right interface. You will need to use source based routing on your instance to make this work.

这篇关于dhclient正确后,AWS第二个弹性IP无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆