You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
windows: 'Disable-NetAdapter -Name "{{interface}}" -Confirm:([bool]0); Start-Sleep -Seconds 2; Enable-NetAdapter -Name "{{interface}}"; Start-Sleep -Seconds 3; if ("{{gateway}}" -ne "") { netsh interface ip set address "{{interface}}" static {{ip_address}} {{netmask}} {{gateway}} }; Write-Host "Adapter {{interface}} restarted with gateway {{gateway}}"'
97
97
command: ip link set {{interface}} down && sleep 1 && ip link set {{interface}} up && echo "Adapter {{interface}} restarted"
98
98
skip_on_error: true
99
99
args:
100
100
- name: interface
101
101
prompt: "Enter the network interface name (e.g., eth0, ens33, Ethernet)"
102
102
default: "eth0"
103
103
required: true
104
+
- name: ip_address
105
+
prompt: "Enter the alias IP address (e.g., 192.168.1.100)"
106
+
required: true
107
+
- name: netmask
108
+
prompt: "Enter the subnet mask (e.g., 255.255.255.0)"
109
+
default: "255.255.255.0"
110
+
required: false
111
+
- name: gateway
112
+
prompt: "Enter the default gateway to restore after restart (e.g., 192.168.1.1)"
113
+
default: ""
114
+
required: false
104
115
- description: Verify alias IP was added
105
116
platforms:
106
117
ubuntu: ip addr show {{interface}} | grep inet
@@ -200,7 +211,7 @@ versions:
200
211
arch: ip addr show {{interface}} && echo "---" && echo "Verify the IP is no longer listed above"
201
212
alpine: ip addr show {{interface}} && echo "---" && echo "Verify the IP is no longer listed above"
202
213
darwin: ifconfig {{interface}}
203
-
windows: powershell -Command "Get-NetIPAddress -InterfaceAlias '{{interface}}' | Format-Table -AutoSize; Write-Host '--- Verify the IP is no longer listed above'"
214
+
windows: 'Get-NetIPAddress -InterfaceAlias "{{interface}}" | Format-Table -AutoSize; Write-Host "--- Verify the IP is no longer listed above"'
204
215
command: ip addr show {{interface}} && echo "---" && echo "Verify the IP is no longer listed above"
0 commit comments