当我想在firewalld中添加以下规则时:
firewall-cmd --direct --add-rule ipv4 nat POSTROUTING 0 -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to 10.8.0.0/24
我收到此错误:
Error: COMMAND_FAILED: '/usr/sbin/iptables-restore -w -n' failed: iptables-restore v1.4.21: Bad IP address "10.8.0.0/24"
Error occurred at line: 2
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
答案 0 :(得分:-1)
应该是:
def mainStuff():
for a in aa:
aName = aa[a].split('')[-1].split('-')[5]
aName = replaceOne(aName)
aName = replaceTwo(aName)
def replaceOne(aName: str) -> str:
if aName.split('_')[1] == "android":
aName = aName.replace('_android','Android')
return aName
def replaceTwo(aName: str) -> str:
if aName.split('_')[4:7] == "abc":
aName = aName.replace('abc','Tom')
return aName