问题描述
我们希望拥有一个测试云虚拟网络,该网络使我们能够通过 snmp-get获得多个虚拟设备.为此,我正在使用 GNS3 .现在,我们刚刚在EC2(Ubuntu 18)上部署了GNS3服务器,但是我们无法ping或snmp获取GNS3服务器之外的任何路由器.我们可以在GNS3服务器上ping这些设备,但这在另一台服务器或我的计算机上不起作用.
We want to have a Test cloud virtual network that allows us to make an snmp-get over multiple virtual devices. To achieve this I am using GNS3. Now, we just deployed a GNS3 Server on EC2 (Ubuntu 18), but we can't ping nor snmp get any router outside the GNS3 server. We can ping these devices while we are in the GNS3 server, but this does not work from another server or my computer.
已经创建并部署了GNS3服务器.VPG,站点到站点VPN和VPC已创建,并且服务器已添加到该VPC.
The GNS3 server already created and deployed.The VPG, Site to site VPN, and VPC are already created, and the servers were added to this VPC.
推荐答案
经过数周的研究,我们的团队找到了解决方案,如果有人遇到同样的问题,请考虑您的AWS配置中的这些重要点:
After some weeks of research, our team found the solution, if anyone is having this same problem consider these important points in your AWS configuration:
- 服务器A(GNS3)必须与服务器B(要从其ping的测试服务器)位于不同的子网中.
- 必须在AWS config中创建路由表指向GNS3 ips. 使用以下说明
- 在服务器A(在我的情况下是Ubuntu 18)中配置NAT :
- Server A (GNS3) must be in a different Subnet than Server B (Test server that you want to ping from).
- A Route Table must be created in AWS config pointing to the GNS3 ips.
- Configure the NAT in Server A (In my case is an Ubuntu 18) using the following instructions:
设置IP转发和伪装
iptables --table nat --append POSTROUTING --out-interface ens5 -j MASQUERADE
iptables --append FORWARD --in-interface virbr0 -j ACCEPT
启用内核转发数据包
echo 1 > /proc/sys/net/ipv4/ip_forward
应用配置
service iptables restart
这将允许从服务器B访问服务器A中的虚拟GNS3设备(更详细的解释此处).此外,您可能需要测试从服务器B到服务器A(在我的情况下为路由器)中的虚拟设备的SNMP-WALK.
This will allow your virtual GNS3 devices in Server A to be reached from Server B (A more detailed explanation here). Additionally, you might want to test an SNMP-WALK from Server B to your virtual device in Server A (a router in my case).
如果这不起作用,请尝试使用流进行调试登录AWS ,并查看服务器A是否有效地接收了请求.
If this does not work try debugging using flow logs in AWS and looking if server A is effectively receiving the requests.
这篇关于AWS-无法从另一台服务器ping GNS3路由器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!