Closed jamiew0w closed 2 months ago
Hi @jamiew0w
The syntax needs to follow the /e/n/i format, meaning that you should put the post-up
and post-down
statement under a specific stanza
auto eno1
iface eno1
post-up iptables -t nat -A PREROUTING -i eno1 -p tcp --dport 5555 -j DNAT --to 10.0.0.121:5555
post-down iptables -t nat -D PREROUTING -i eno1 -p tcp --dport 5555 -j DNAT --to 10.0.0.121:5555
Hi @jamiew0w
The syntax needs to follow the /e/n/i format, meaning that you should put the
post-up
andpost-down
statement under a specific stanzaauto eno1 iface eno1 post-up iptables -t nat -A PREROUTING -i eno1 -p tcp --dport 5555 -j DNAT --to 10.0.0.121:5555 post-down iptables -t nat -D PREROUTING -i eno1 -p tcp --dport 5555 -j DNAT --to 10.0.0.121:5555
Thank you! I'll go ahead and close this out, I really should have tried this before making an issue - my bad!
hello.
i route a lot of ports and the interfaces file gets a bit unwieldy. i was testing with the
source-directory
because that'd make my life a lot easier (plus allow cool things like scripting symlinks to bring stuff up and down) but i've ran into issues very quickly.network/interfaces:
source-directory /etc/network/interfaces.d
(tested with at the top and bottom of the file if that matters)interfaces.d/test
error
thing is, if i simply cat the rule and put it back in the
interfaces
file then reload, all is fine.is this not supported via
source-directory
?