-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to load configuration in zeroized device via telnet to console port #44
Comments
@Jainpriyal I am encountering a similar problem with pushing a config to a zeroized vRR using an ESXi networked serial port. I want to make sure I understand what you are trying to do. A zeroized device will be in amnesiac mode and won't have a demo user. Did you do some minimal configuration before executing netconify? What do you see if you add --verbose 1 or --verbose 2? |
Can you connect and watch the console of the device? If the device is logging anything to the console, then it disrupts the NETCONF session. If the device is trying to perform ZTP, I find that it often logs messages to the console. |
@stacywsmith I'm not sure what you mean. How would I do that if netconify is using the serial port? The vRR is zeroized. I can see that the program connects successfully as root.
If I launch the netconf session manually and send an RPC, I am unable to type anything including a carriage return. I used the telnet escape sequence to exit. I am wondering if this might be the problem.
I'm using an ESXi networked serial port. |
Many terminal servers support simultaneous connections to the same port. In that case, you simply connect to the same serial port as netconify and "snoop" the communication.
Not sure if ESXi networked serial port allows simultaneous connections to the same port or not. |
I've attached a packet capture of the telnet session to the ESXI networked serial port. It looks as I'd expect until packet 8 in which my laptop sends a percentage sign to the vRR. After that, I'm not clear on why my laptop gets the xml-mode command back and then the program reads the login prompt again. esxi networked serial port.zip The output below matches the packet capture.
|
It appears both sides of the connection are echoing characters they receive. The vrr sends a percent sign to the laptop in packet 5. The laptop echoes that percent sign back in packet 8. The client sends "root" in packet 10 and the vrr echoes that back in packet 13. The client sends "xml-mode netconf need-trailer" in packet 12, and the vrr echoes that back in packet 15. The vrr also sends "Password:" in packet 15. Bottom line is I'm not sure the ESXI networked serial port and the VRR are configured correctly. I suspect the echoing is causing the username to be interpreted as %. This is causing the device to prompt for a password for the % user. |
After researching, I see that packet 5 contains a telnet control command: FF(IAC) FD(DO) 25 (AUTHENTICATION). ASCII 0x25 is the percentage sign. The response in packet 8 is FF (IAC) FC(WONT) 25 (AUTHENTICATION). While this may not be the root cause of my issue, it seems like netconify should ignore telnet control commands like the pexpect module command does.
Note: The ESXi's networked serial port requires a CR before displaying the login prompt. This is another potential reason for the error that I'm investigating. @Jainpriyal Any chance you could post a packet capture? If my issue is differs from yours, I can open an issue that specifically tracks the problem with ESXi networked serial ports. Also, does your console require a CR to get the login prompt? |
If no option negotiation callback function is set, telnetlib will pass Telnet options back to netconify in the data stream. This is especially problematic for the AUTHENTICATION (0x25) option. 0x25 is an ASCII % character and confuses the login state machine into thinking that it is at the shell prompt. This function simply receives and ignores Telnet options. This prevents the options from appearing in the data stream and confusing the login state machine.
Can you please try out my proposed fix? sudo pip uninstall junos-netconify @jeffbrl has confirmed it addresses his problem, but I'd like to confirm that your problem is really the same issue. |
I am trying to load config file to device at zeroized state via console port.
But it is getting hanged after starting netconf...
The text was updated successfully, but these errors were encountered: