[英]Could not ping secondary interface private IP
I have attached a secondary interface to Debian EC2 instance. 我已将辅助接口附加到Debian EC2实例。 I attached the same security group that primary interface has and it allows ping on it. 我附加了与主接口相同的安全组,并允许对其执行ping操作。 Problem is after attaching the second network interface I am not able to ping the Secondary interface private IP. 问题是连接第二个网络接口后,我无法ping通辅助接口专用IP。
eth0 Link encap:Ethernet HWaddr 0a:65:1c:fd:cd:f0
inet addr:10.195.0.76 Bcast:10.195.0.95 Mask:255.255.255.224
inet6 addr: fe80::865:1cff:fefd:cdf0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:9001 Metric:1
RX packets:1494 errors:0 dropped:0 overruns:0 frame:0
TX packets:1158 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:164133 (160.2 KiB) TX bytes:185670 (181.3 KiB)
eth1 Link encap:Ethernet HWaddr 0a:2d:a1:fc:f5:d4
inet addr:10.195.0.82 Bcast:10.195.0.95 Mask:255.255.255.224
inet6 addr: fe80::82d:a1ff:fefc:f5d4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:9001 Metric:1
RX packets:274 errors:0 dropped:0 overruns:0 frame:0
TX packets:46 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:24474 (23.9 KiB) TX bytes:2948 (2.8 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Ngrep result pinging from other interface: Ngrep结果从其他接口执行ping操作:
root@ip-10-195-0-76:/home/admin# ngrep -d eth1 -Wbyline
interface: eth1 (10.195.0.64/255.255.255.224)
#
I fe80::81a:8eff:fe7b:e6a9 -> ff02::1 134:0
@.............
..{....@.............*....to.........
#
I 10.195.1.30 -> 10.195.0.82 8:0
\......[.....X
..................... !"#$%&'()*+,-./01234567
#
I 10.195.1.30 -> 10.195.0.82 8:0
\......[......
..................... !"#$%&'()*+,-./01234567
Debian in AWS does provide ec2-net-utils but the scripts on EC2 does not add the routes for the secondary interface. AWS中的Debian确实提供了ec2-net-utils,但EC2上的脚本未添加辅助接口的路由。 To solve this i followed the following to add the routes for the interface. 为了解决这个问题,我遵循以下步骤为接口添加路由。
#echo "200 out" >>/etc/iproute2/rt_tables
# ip route add default via 10.195.0.65 dev eth1 table out
#ip route show table out
#ip rule add from 10.195.0.82/32 table out
#ip rule add to 10.195.0.82/32 table out
And after that i am able ping the network interface. 之后,我可以ping通网络接口。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.