## Linux See also: - - The syntax is as follows to add an IPv4/IPv6 address: ```sh ip addr add {ip_addr/mask} dev {interface} ``` To add a new route, the syntax is: ```sh ip route add {NETWORK/MASK} via {GATEWAYIP} ip route add {NETWORK/MASK} dev {DEVICE} ## Add default route using ip ## ip route add default {NETWORK/MASK} dev {DEVICE} ip route add default {NETWORK/MASK} via {GATEWAYIP} ``` For example, to add a plain route to network `192.168.1.0/24` via gateway `192.168.1.254`: ```sh ip route add 192.168.1.0/24 via 192.168.1.254 ``` ## Darwin/BSD See also: - **macOS**: - - **BSD**: - - - To add an IPv4/IPv6 address in BSD family systems: - **IPv4**: `ifconfig
netmask ` - **IPv6**: `ifconfig inet6
prefixlen ` To add routes in BSD family systems: - **IPv4**: `route add -net ` - **IPv6**: `route add -net -inet6 ` ## Windows See also: - - Netsh Commands: - - - To add an IPv4/IPv6 address on Windows: - **IPv4**: `netsh interface ipv4 set address static
` - **IPv4**: `netsh interface ipv6 set address static
` For example, to add a static IPv4 address for "NetLAN1" and specify both the subnet mask and gateway, type: ```sh netsh interface ipv4 set address "NetLAN1" static ``` To add routes on Windows: - **IPv4**: `netsh interface ipv4 add route ` - **IPv4**: `netsh interface ipv6 add route `