首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >OpenVZ (CentOS 7)之前没有互联网接入

OpenVZ (CentOS 7)之前没有互联网接入
EN

Server Fault用户
提问于 2018-11-20 00:54:12
回答 1查看 713关注 0票数 1

奇怪的问题..。我使用的是OpenVZ,有3个容器。我的设置工作了3年,昨天发生了一些事情,我似乎找不到一个容器上的问题。另外两个按预期工作。

这是我的openvz设置

代码语言:javascript
复制
[root@node1 ~]# vzlist -a
      CTID      NPROC STATUS    IP_ADDR         HOSTNAME
       101        133 running   67.212.65.43    serveur1.***.com
       102        139 running   67.212.65.44    serveur2.***.com
       103        187 running   67.212.65.45    serveur3.***.com

有问题的集装箱在67.212.65.43,另外2个正在正常工作,我的供应商告诉我,从那里算起,一切正常。

代码语言:javascript
复制
[root@node1 ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
67.212.65.44    0.0.0.0         255.255.255.255 UH    0      0        0 venet0
67.212.65.45    0.0.0.0         255.255.255.255 UH    0      0        0 venet0
67.212.65.46    0.0.0.0         255.255.255.255 UH    0      0        0 venet0
67.212.65.43    0.0.0.0         255.255.255.255 UH    0      0        0 venet0
67.212.65.40    0.0.0.0         255.255.255.248 U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0
0.0.0.0         67.212.65.41    0.0.0.0         UG    0      0        0 eth0

我可以通过输入以下内容来输入错误的容器:

输入101

这就是我试过的结果:

代码语言:javascript
复制
[root@serveur1 /]# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms

[root@serveur1 /]# traceroute 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
send: Operation not permitted

[root@serveur1 /]# nslookup 8.8.8.8
;; connection timed out; no servers could be reached

我试着做一个iptables,但这并没有解决任何问题。现行规则是:

代码语言:javascript
复制
[root@serveur1 etc]# iptables -L
Chain INPUT (policy DROP)
target     prot opt source               destination

Chain FORWARD (policy DROP)
target     prot opt source               destination

Chain OUTPUT (policy DROP)
target     prot opt source               destination

Chain ALLOWIN (0 references)
target     prot opt source               destination

Chain ALLOWOUT (0 references)
target     prot opt source               destination

Chain DENYIN (0 references)
target     prot opt source               destination

Chain DENYOUT (0 references)
target     prot opt source               destination

Chain INVALID (0 references)
target     prot opt source               destination

Chain INVDROP (0 references)
target     prot opt source               destination

Chain LOCALINPUT (0 references)
target     prot opt source               destination

Chain LOCALOUTPUT (0 references)
target     prot opt source               destination

Chain LOGDROPIN (0 references)
target     prot opt source               destination

Chain LOGDROPOUT (0 references)
target     prot opt source               destination

Chain cpanel-dovecot-solr (0 references)
target     prot opt source               destination

Chain f2b-sshd (0 references)
target     prot opt source               destination

我开始检查我的服务器网络配置..。但就像我说的,三年来一切都很顺利.我是迷失之王,需要帮助找到问题。

resolv.conf:

由NetworkManager

生成

命名服务器8.8.8.8命名服务器8.8.4.4

ifconfig

代码语言:javascript
复制
[root@serveur1 etc]# ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 60  bytes 4200 (4.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 60  bytes 4200 (4.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

venet0: flags=211<UP,BROADCAST,POINTOPOINT,RUNNING,NOARP>  mtu 1500
        inet 127.0.0.1  netmask 255.255.255.255  broadcast 0.0.0.0  destination 127.0.0.1
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 0  (UNSPEC)
        RX packets 45325  bytes 2970128 (2.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 51  bytes 14395 (14.0 KiB)
        TX errors 0  dropped 2 overruns 0  carrier 0  collisions 0

venet0:0: flags=211<UP,BROADCAST,POINTOPOINT,RUNNING,NOARP>  mtu 1500
        inet 67.212.65.43  netmask 255.255.255.255  broadcast 67.212.65.43  destination 67.212.65.43
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 0  (UNSPEC)

一切似乎都是正确的..。让我知道你需要什么额外的信息,我会发布一个编辑。

EN

回答 1

Server Fault用户

回答已采纳

发布于 2018-11-20 20:13:29

好的,我找到了解决这个问题的方法。在刷新了iptable的规则之后,我需要像这样重新创建它们:

代码语言:javascript
复制
iptables -P INPUT ACCEPT
iptables -F OUTPUT
iptables -F FORWARD

完成此操作后,服务器再次开始响应。希望如果将来有人犯了这个错误,这会有所帮助。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/940796

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档