0
にエコー:は、私は、Ciscoのコンソールポートに接続するためにpythonでpyserialを使用するコンソール接続
>>> import serial
>>> console = serial.Serial('COM5')
>>> console.read(console.inWaiting())
''
>>> console.write('sh ip inter brie\n')
17L
>>> console.read(console.inWaiting())
'sh ip inter brie\r\nInterface IP-Address OK? Method Statu
s Protocol\r\nFastEthernet0 unassigned YES NVRA
M up down \r\nFastEthernet1 unassigned
YES manual up down \r\nBRI0 unassign
ed YES NVRAM administratively down down \r\nBRI0:1
unassigned YES unset administratively down down \r\nBRI0:2
unassigned YES unset administratively down down \r\nFastEtherne
t2 unassigned YES unset up down \r\nFas
tEthernet3 unassigned YES unset up down
\r\nFastEthernet4 unassigned YES unset up
down \r\nFastEthernet5 unassigned YES unset up
down \r\nFastEthernet6 unassigned YES unset up
down \r\nFastEthernet7 unassigned YES unse
t up down \r\n --More-- '
>>>
応答で反響があり除き、それは良い作品。それを無効にする方法はありますか?
*「返信はエコーがあります」とはどういう意味ですか?私が見ることができるのは、あなたのコマンドに対する応答です。 – SiHa
私はコマンド 'sh ip inter brie \ n'を送り、応答は 'sh ip inter brie \ r \ n'で始まります。コマンドを私に送り返す理由はありません。私はtelnetとiでエコーをオフにすることが可能であることを知っているので、コンソール接続で可能かどうかを知ることができます – Ivan