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
When setting very long command for PostUp, PostDown or PreDown, or command containing shell variables reference, after applying config, command is truncated.
After reapplying config it becomes (shown in web ui):
iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth+ -j MASQUERADE; iptables -t nat -A PREROUTING -p
which makes absolutely unuseful specifying long custom configuration for iptables.
I've checked wg0.conf after first apply - command matches original. After opening settings in web ui, command is truncated in settings and truncated after second config apply.
I'm using portainer and don't know how to add external files in it unlike in standalone docker on host, so it's important to use long command for custom forwarding rules (preferrable with shell functions to make them shorter), but I can't.
UPD: When settting same config without quotes, everything works
The text was updated successfully, but these errors were encountered:
I had the same problem and I also have a lot of iptables commands. In my opinion, the cleanest solution is to outsource the commands to a script. The script is then executed via PostUp or PostDown
PostUp = /etc/wireguard/ifscript.sh up
PostDown = /etc/wireguard/ifscript.sh down
if [ "$1" = "up" ]; then .... your PostUp Commands elif [ "$1" = "down" ]; then .... your PostDown Commands fi
When setting very long command for PostUp, PostDown or PreDown, or command containing shell variables reference, after applying config, command is truncated.
Example:
After reapplying config it becomes (shown in web ui):
Example 2:
After reapplying config it becomes (shown in web ui):
which makes absolutely unuseful specifying long custom configuration for iptables.
I've checked wg0.conf after first apply - command matches original. After opening settings in web ui, command is truncated in settings and truncated after second config apply.
I'm using portainer and don't know how to add external files in it unlike in standalone docker on host, so it's important to use long command for custom forwarding rules (preferrable with shell functions to make them shorter), but I can't.
UPD: When settting same config without quotes, everything works
The text was updated successfully, but these errors were encountered: