Skip to main content


Retrieve a description of the connection open through the network interface




Table — connection configuration information


This method returns a table which details the interface’s currently open connection. This table currently contains a single key, ipv4, whose value is itself a table containing the following primary keys:

Key Type Notes
address String The imp’s IP address, eg. ""
broadcast String The network router’s broadcast IP address eg. ""
dhcpserver String The DHCP server’s IP address, or absent if the imp has a static IP address
dnsserver Array One or two DNS server addresses each in "" form
gateway String The network’s gateway IP address eg. ""
netmask String The network’s mask eg. ""
proxy Table A proxy server’s details (see below), or absent if no proxy has been set (with imp.setproxy())
server Table The imp server’s connection details (see below)

Note Any field in the above and following tables that provides a dotted quad value – for example, the address field in this ipv4 table – is optional in as much as it will not be included in the table if the value is determined to be You should always test for the presence of any such a key in the returned table (for instance, if ("address" in interface.getiptable()) {...}) or embed your lookup code in a try...catch structure.

The ipv4 table’s proxy key’s value, if present, is itself a table with the following keys:

proxy Key Type Notes
address String The proxy’s IP address, eg. ""
port Integer The proxy’s port, eg. 80
type Integer The proxy type (see imp.setproxy())
user String The proxy username, when configured

The ipv4 table’s server key’s value is a table with the following keys:

server Key Type Notes
port Integer The server’s port, eg. 31314
tcpsendwindow Integer TCP window size in bytes
tcptimeout Float Timeout in seconds
tcpwaitfor Integer WAIT_TIL_SENT or WAIT_FOR_ACK

Note This information mirrors the ipv4 table included in the data returned by