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: 'netsh interface ip add address "{{interface}}" {{ip_address}} {{netmask}}'
33
33
command: ip addr add {{ip_address}}/{{prefix}} dev {{interface}} label {{interface}}:{{label}}
34
34
skip_on_error: false
35
35
args:
@@ -40,6 +40,10 @@ versions:
40
40
prompt: "Enter the subnet prefix length (e.g., 24 for /24)"
41
41
default: "24"
42
42
required: false
43
+
- name: netmask
44
+
prompt: "Enter the subnet mask (e.g., 255.255.255.0)"
45
+
default: "255.255.255.0"
46
+
required: false
43
47
- name: interface
44
48
prompt: "Enter the network interface name (e.g., eth0, ens33, Ethernet)"
45
49
default: "eth0"
@@ -56,7 +60,7 @@ versions:
56
60
rhel: 'cat > /etc/sysconfig/network-scripts/ifcfg-{{interface}}:{{label}} << EOF\nDEVICE={{interface}}:{{label}}\nIPADDR={{ip_address}}\nNETMASK={{netmask}}\nONBOOT=yes\nEOF\necho "Alias IP config created at /etc/sysconfig/network-scripts/ifcfg-{{interface}}:{{label}}"'
windows: powershell -Command "New-NetIPAddress -InterfaceAlias '{{interface}}' -IPAddress '{{ip_address}}' -PrefixLength {{prefix}} -SkipAsSource ([bool]1); Write-Host 'Windows IP aliases are persistent by default'"
63
+
windows: 'netsh interface ip add address "{{interface}}" {{ip_address}} {{netmask}}; Write-Host "Windows IP aliases added via netsh are persistent by default"'
0 commit comments