KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
It turns out that iptables doesn't handle leading zeros too well. As $machinenumber that is used has to have a leading zero in it for other purposes, the idea is simply to create a new variable ( $nozero ) based on $machinenumber , where leading zeros are stripped away. $machinenumber is a two-digit number between 01 and 24. Currently it's 09 $machinetype is 74 for now and hasn't caused any problems before. What I have so far is: nozero = (echo $machinenumber | sed 's/^0*//') iptables -t nat -I POSTROUTING -s 10.($machinetype).($nozero).0/24 -j MASQUERADE While I believe I'm on the right track, the code results in: ERROR - Unknown string operation
Tags (comma-separated)
Save Edits
Cancel