问题描述
朋友, 有谁知道为什么这段代码可以在思科的路由器上完美运行,而在华为路由器上却可以正常使用并且无法完成?
# Its the same concept,works like a proxy forwarding Linux traffic
$ sysctl -w net.ipv4.conf.all.route_localnet=1
$ iptables -t nat -I PREROUTING -p tcp -j DNAT --to-destination 127.0.0.1
解决方法
有效。像这样:
def receive_data(pLenght,pTimeout):
for x in range(pTimeout):
time.sleep(1)
r = channel.recv(2024)
z = r.decode('utf-8','ignore')
if len(z) > pLenght:
break
return z
channel = ssh_RT.invoke_shell()
channel.send('dis ip int br\n')
out = receive_data(50,5)