configure_host
Set host IPv4 configuration via DHCP or static IP with mask, gateway, and DNS. Validates common mistakes before applying to Packet Tracer.
Instructions
Set the IPv4 configuration of a PC, laptop or server: either DHCP, or a static ip and mask with optional gateway and DNS. Catches classic mistakes (invalid mask, host address equal to the network or broadcast, gateway outside the subnet) before touching Packet Tracer.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | No | Static IPv4 address, for example `192.168.10.10`. Required unless `dhcp` is true. | |
| dns | No | DNS server address. | |
| dhcp | No | Get the address from a DHCP server instead of setting it statically. | |
| mask | No | Subnet mask, for example `255.255.255.0`. Required unless `dhcp` is true. | |
| port | No | Network port to configure. Defaults to `FastEthernet0`. | |
| device | Yes | PC, laptop or server name. | |
| gateway | No | Default gateway; must be inside the host's subnet. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | No | ||
| dns | No | ||
| dhcp | Yes | ||
| mask | No | ||
| port | Yes | ||
| device | Yes | ||
| gateway | No |