Skip to content

Commit dda34d1

Browse files
authored
fix: 更新说明
1 parent c355d6d commit dda34d1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

docs/incomplete/webvirtcloud.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,14 @@ Virtance-1 192.168.33.114 52:54:00:5f:77:92 21422 31400 31409
252252

253253
##### 清理所有规则
254254

255-
如需清理所有端口映射规则:
256255
```bash
257256
systemctl stop vm-port-mapping
258-
iptables -t nat -F PREROUTING
259-
iptables -t nat -F POSTROUTING
257+
grep -f /etc/vm_port_mapping/mapping.txt | while read -r vm_name ip_address mac ssh_port port_start port_end; do
258+
firewall-cmd --permanent --remove-forward-port="port=$ssh_port:proto=tcp:toport=22:toaddr=$ip_address"
259+
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
260263
firewall-cmd --reload
261264
```
262265

0 commit comments

Comments
 (0)