The list of networking commands
net_add_addr
Command: net_add_addr interface card address
Add a network address. Configure additional network interface with address on a network card. address can be either IP in dotted decimal notation, or symbolic name which is resolved using DNS lookup. If successful, this command also adds local link routing entry to the default subnet of address with name interface‘:local’ via interface.
net_add_dns
Command: net_add_dns server
Add a DNS server. Resolve server IP address and add to the list of DNS servers used during name lookup.
net_add_route
Command: net_add_route shortname ip[/prefix] [interface | ‘gw’ gateway]
Add route to network with address ip as modified by prefix via either local interface or gateway. prefix is optional and defaults to 32 for IPv4 address and 128 for IPv6 address. Route is identified by shortname which can be used to remove it (see net_del_route).
net_bootp
Command: net_bootp [card]
Perform a bootp/DHCP autoconfiguration. Alias for net_dhcp, for compatibility with older Grub versions. Will perform the same DHCP handshake with potential fallback to BOOTP as the net_dhcp command (see net_dhcp).
net_del_addr
Command: net_del_addr interface
Remove configured interface with associated IP address.
net_del_dns
Command: net_del_dns address
Remove address from list of servers used during name lookup.
net_del_route
Command: net_del_route shortname
Remove route entry identified by shortname.
net_dhcp
Command: net_dhcp [card]
Perform configuration of card using DHCP protocol. If no card name is specified, try to configure all existing cards. Falls back to the BOOTP protocol, if needed. If configuration was successful, interface with name card‘:dhcp’ and configured address is added to card. Additionally the following DHCP options are recognized and processed:
‘1 (Subnet Mask)’
Used to calculate network local routing entry for interface card‘:dhcp’.
‘3 (Router)’
Adds default route entry with the name card‘:dhcp:default’ via gateway from DHCP option. Note that only option with single route is accepted.
‘6 (Domain Name Server)’
Adds all servers from option value to the list of servers used during name resolution.
‘12 (Host Name)’
Sets environment variable ‘net_’<card>‘_dhcp_hostname’ (see net_<interface>_hostname) to the value of option.
‘15 (Domain Name)’
Sets environment variable ‘net_’<card>‘_dhcp_domain’ (see net_<interface>_domain) to the value of option.
‘17 (Root Path)’
Sets environment variable ‘net_’<card>‘_dhcp_rootpath’ (see net_<interface>_rootpath) to the value of option.
‘18 (Extensions Path)’
Sets environment variable ‘net_’<card>‘_dhcp_extensionspath’ (see net_<interface>_extensionspath) to the value of option.
‘66 (TFTP Server Name)’
Sets environment variable ‘net_’<card>‘_dhcp_server_name’ (see net_<interface>_dhcp_server_name) to the value of option.
‘67 (Filename)’
Sets environment variable ‘net_’<card>‘_boot_file’ (see net_<interface>_boot_file) to the value of option.
net_get_dhcp_option
Command: net_get_dhcp_option var interface number type
Request DHCP option number of type via interface. type can be one of ‘string’, ‘number’ or ‘hex’. If option is found, assign its value to variable var. Values of types ‘number’ and ‘hex’ are converted to string representation.
net_ipv6_autoconf
Command: net_ipv6_autoconf [card]
Perform IPv6 autoconfiguration by adding to the card interface with name card‘:link’ and link local MAC-based address. If no card is specified, perform autoconfiguration for all existing cards.
net_ls_addr
Command: net_ls_addr
List all configured interfaces with their MAC and IP addresses.
net_ls_cards
Command: net_ls_cards
List all detected network cards with their MAC address.
net_ls_dns
Command: net_ls_dns
List addresses of DNS servers used during name lookup.
net_ls_routes
Command: net_ls_routes
List routing entries.
net_nslookup
Command: net_nslookup name [server]
Resolve address of name using DNS server server. If no server is given, use default list of servers.