We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c355d6d commit dda34d1Copy full SHA for dda34d1
docs/incomplete/webvirtcloud.md
@@ -252,11 +252,14 @@ Virtance-1 192.168.33.114 52:54:00:5f:77:92 21422 31400 31409
252
253
##### 清理所有规则
254
255
-如需清理所有端口映射规则:
256
```bash
257
systemctl stop vm-port-mapping
258
-iptables -t nat -F PREROUTING
259
-iptables -t nat -F POSTROUTING
+grep -f /etc/vm_port_mapping/mapping.txt | while read -r vm_name ip_address mac ssh_port port_start port_end; do
+ firewall-cmd --permanent --remove-forward-port="port=$ssh_port:proto=tcp:toport=22:toaddr=$ip_address"
+ for ((port=port_start; port<=port_end; port++)); do
260
+ firewall-cmd --permanent --remove-forward-port="port=$port:proto=tcp:toport=$port:toaddr=$ip_address"
261
+ done
262
+done
263
firewall-cmd --reload
264
```
265
0 commit comments