I haven't tried using PyVISA with my E2050A yet, I have only used it with the Agilent / Keysight IO Libraries software so far. I'll have to try using it with PyVISA sometime.
It is also possible to do the initial configuration of the E2050A through the serial port instead getting it configured for a Telnet connection. That might be easier in some cases.
You can connect a terminal or PC running a terminal emulator to the E2050A RS-232 port using a null modem cable at 19200,N,8,1 and after hitting <CR> it should bring up the configuration menu.
Serial port output at 19200,N,8,1 after sending a CR to the E2050A after power up:
Welcome to the E2050A LAN/HP-IB Gateway configuration utility.
Commands
? Show additional commands
exit, quit Exit WITHOUT saving configuration changes
reboot Save configuration changes and restart
status Show the LAN/HP-IB Gateway connection status
Configuration Parameters
hostname: E2050 # Internet domain name
hardware-addr: 0800091AEE6E # Ethernet station address
ip: 192.168.1.20 # Internet Protocol address
default-gw: 192.168.1.1 # Default subnet gateway IP address
subnet-mask: 255.255.255.0 # Network subnet mask
syslog-svr: 0.0.0.0 # Syslog server IP address
bootp: OFF # Obtain config via BOOTP/TFTP
lan-timeout: 0 # LAN connect timeout in seconds
io-timeout: 120 # Server I/O timeout in seconds
allow: * # IP allow list
hpib-address: 21 # HP-IB System Controller Address
hpib-name: gpib0 # HP-IB interface symbolic name
hpib-unit: 7 # HP-IB logical unit number
> ?
Available commands are:
allow: <ip> [<ip>] Set the allow list for IP security
bootp: <ON|OFF> Turn ON or OFF use of BOOTP/TFTP
bye Quit without saving configuration - see reboot
config Show current settings
default-gw: <ip address> Set the default subnet gateway address
exit Exit without saving configuration - see reboot
factory-reset Reset configuration to factory defaults and reboot
hardware-addr Display the ethernet station address
help Print help information
hostname: <string*35> Set the internet domain name
hpib-address: <0-30> Set the HP-IB system controller address
hpib-name: <string*15> Set the HP-IB interface symbolic name
hpib-unit: <1-255> Set the HP-IB logical unit number
io-timeout: <seconds> Set the server I/O timeout in seconds. 0 is Off.
ip: <ip address> Set the IP address
lan-timeout: <seconds> Set the LAN connect timeout in seconds. 0 is Off.
quit Quit without saving configuration - see reboot
reboot Save configuration and restart
status Show the LAN/HP-IB Gateway connection status
subnet-mask: <mask> Set the network subnet mask
syslog-clear Clear the syslog
syslog-display Display the syslog contents
syslog-svr: <ip address> Set the syslog server address
version Show the firmware revision
> version
Software revision A.01.03
Bootrom revision A.01.00