没有主持C级外部IP的路由

时间:2016-01-09 05:50:34

标签: networking routes external openstack openstack-neutron

计算节点上启动的VM实例可以访问除C-Class IP之外的所有外部Internet网站。根据ubuntu上的openstack自由指南,控制器和计算节点已成功安装。

  

[root @ vm3~] #wget http://www.sina.com.cn解析www.sina.com.cn ...   202.108.33.60正在连接到www.sina.com.cn | 202.108.33.60 |:80 ... failed:无路由主持人。

但是,可以成功访问A-CLass和B-Class外部IP:

 [root@vm3 ~]# wget http://www.163.com
    Resolving www.163.com... 60.207.246.98, 124.202.166.57
    Connecting to www.163.com|60.207.246.98|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: unspecified [text/html]
    Saving to: “index.html.1”

VM的界面是:

  

[root @ vm3~] #ifconfig       eth1链接封装:以太网HWaddr FA:16:3E:57:1B:57
                inet addr:192.168.0.215 Bcast:255.255.255.255掩码:192.0.0.0                 inet6 addr:fe80 :: f816:3eff:fe57:1b57 / 64范围:链接                 UP BROADCAST RUNNING MULTICAST MTU:1450公制:1                 RX数据包:46213错误:0丢弃:0超限:0帧:0                 TX数据包:42118错误:0丢弃:0溢出:0载波:0                 碰撞:0 txqueuelen:1000                 RX字节:13492902(12.8 MiB)TX字节:39875879(38.0 MiB)

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:16436  Metric:1
          RX packets:58630 errors:0 dropped:0 overruns:0 frame:0
          TX packets:58630 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:44931488 (42.8 MiB)  TX bytes:44931488 (42.8 MiB)

virbr0    Link encap:Ethernet  HWaddr 52:54:00:D2:F5:28  
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  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)

VM上的路由是:

 [root@vm3 ~]# route -n
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    169.254.169.254 192.168.0.200   255.255.255.255 UGH   0      0        0 eth1
    192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
    192.0.0.0       0.0.0.0         192.0.0.0       U     1      0        0 eth1
    0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth1

我创建了启动VM的公共网络。 公共网络为192.168.0.0/24,私有网络为10.0.0.0/24。 控制器:192.168.0.12/10.0.0.11 compute:192.168.0.10/10.0.0.31

如果我明确添加202.108.33.60的路由,wget可以工作:

路线添加202.108.33.60 gw 1​​92.168.0.1

    [root@vm3 ~]# route -n
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    202.108.33.60   192.168.0.1     255.255.255.255 UGH   0      0        0 eth1
    169.254.169.254 192.168.0.200   255.255.255.255 UGH   0      0        0 eth1
    192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
    192.0.0.0       0.0.0.0         192.0.0.0       U     1      0        0 eth1
    0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth1

是否有人知道原因或提供有关如何调试此问题的帮助? 非常感谢!

1 个答案:

答案 0 :(得分:0)

几天后'分析和挖掘,最终我发现原因是路由条目" 192.0.0.0 0.0.0.0 192.0.0.0 U 1 0 0 eth1"它将过滤所有C级IP作为LAN(邻居网络),偶尔www.sina.com.cn就是这样的主机。 我将其更改为如下所示后,即可访问www.sina.com.cn。

  

192.0.0.0 0.0.0.0 255.0.0.0 U 1 0 0 eth1