【发布时间】:2017-01-23 06:53:47
【问题描述】:
我是 fedora 的新手,我误删除了我的 /etc/sysconfig/ifcfg-enp0s25 时遇到了这个可怕的问题。
然后我的ip变成了外部ip xxx.xx.6.168。
为了将我的 ip 解决为内部 ip,我尝试使用 # vi ifcfg-enp0s25 重建文件并插入:
DEVICE=enp0s25
NAME=enp0s25
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Ethernet
然后# service network restart
我的IP变成了:10.xx.xx.0
这个IP可以连接内网成功,但获取自己的socket时出错:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "ldtp/__init__.py", line 593, in <module>
_populateNamespace(globals())
File "ldtp/__init__.py", line 247, in _populateNamespace
for method in client._client.system.listMethods():
File "/usr/lib64/python2.7/xmlrpclib.py", line 1243, in __call__
return self.__send(self.__name, args)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1602, in __request
verbose=self.__verbose
File "ldtp/client.py", line 146, in request
self.send_content(h, request_body)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1459, in send_content
connection.endheaders(request_body)
File "/usr/lib64/python2.7/httplib.py", line 1053, in endheaders
self._send_output(message_body)
File "/usr/lib64/python2.7/httplib.py", line 897, in _send_output
self.send(msg)
File "/usr/lib64/python2.7/httplib.py", line 859, in send
self.connect()
File "/usr/lib64/python2.7/httplib.py", line 836, in connect
self.timeout, self.source_address)
File "/usr/lib64/python2.7/socket.py", line 575, in create_connection
raise err
socket.error: [Errno 113] No route to host
那我怎样才能回到我过去的IP??
任何建议都有帮助!
【问题讨论】:
-
您可能还想发布这个问题Superuser,重点是操作系统管理。
-
@jesper_bk 感谢您的建议,我现在发布!
标签: python sockets networking operating-system ip