How to load saved iptables rules on rebootingiptables-restore failing to load my rulesiptables-persistent doesn't load rules on bootCorosync & Pacemaker IPTables RulesList active rules in IptablesMasquerade over USB Ethernet ProblemHow do I stop iptables restoring to an earlier version every reboot?boot 14.04 iptables fails intermittentlyRules in iptablesHow to route VLAN subnetworks to my DSL ppp0Long iptables rules efficiency & performance
What are the balance implications behind making invisible things auto-hide?
Can a stoichiometric mixture of oxygen and methane exist as a liquid at standard pressure and some (low) temperature?
Is there a way to get `mathscr' with lower case letters in pdfLaTeX?
Quoting Keynes in a lecture
Creepy dinosaur pc game identification
Are Captain Marvel's powers affected by Thanos' actions in Infinity War
Does malloc reserve more space while allocating memory?
Why did the EU agree to delay the Brexit deadline?
Multiplicative persistence
Can I still be respawned if I die by falling off the map?
How can mimic phobia be cured?
Does the Linux kernel need a file system to run?
How do I delete all blank lines in a buffer?
What are the advantages of simplicial model categories over non-simplicial ones?
Pre-mixing cryogenic fuels and using only one fuel tank
How do you make your own symbol when Detexify fails?
What does "Scientists rise up against statistical significance" mean? (Comment in Nature)
Temporarily disable WLAN internet access for children, but allow it for adults
Plot of a tornado-shaped surface
putting logo on same line but after title, latex
PTIJ: Haman's bad computer
How do you respond to a colleague from another team when they're wrongly expecting that you'll help them?
Angel of Condemnation - Exile creature with second ability
How should I respond when I lied about my education and the company finds out through background check?
How to load saved iptables rules on rebooting
iptables-restore failing to load my rulesiptables-persistent doesn't load rules on bootCorosync & Pacemaker IPTables RulesList active rules in IptablesMasquerade over USB Ethernet ProblemHow do I stop iptables restoring to an earlier version every reboot?boot 14.04 iptables fails intermittentlyRules in iptablesHow to route VLAN subnetworks to my DSL ppp0Long iptables rules efficiency & performance
I used pre-up in /etc/network/interfaces. It's strange, I have two Ubuntu server, one a PC and another a VPS. This method works on my PC but not on my VPS.
This is the /etc/network/interfaces on my PC
# ifupdown has been replaced by netplan(5) on this system. See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
# sudo apt install ifupdown
auto dsl-provider
iface dsl-provider inet ppp
pre-up /bin/ip link set eno1 up # line maintained by pppoeconf
provider dsl-provider
#auto eno1
#iface eno1 inet manual
pre-up iptables-restore < /etc/iptables.rules
This is the /etc/network/interfaces on my VPS
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
pre-up iptables-restore < /etc/iptables.rules
source /etc/network/interfaces.d/*
iptables netplan
add a comment |
I used pre-up in /etc/network/interfaces. It's strange, I have two Ubuntu server, one a PC and another a VPS. This method works on my PC but not on my VPS.
This is the /etc/network/interfaces on my PC
# ifupdown has been replaced by netplan(5) on this system. See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
# sudo apt install ifupdown
auto dsl-provider
iface dsl-provider inet ppp
pre-up /bin/ip link set eno1 up # line maintained by pppoeconf
provider dsl-provider
#auto eno1
#iface eno1 inet manual
pre-up iptables-restore < /etc/iptables.rules
This is the /etc/network/interfaces on my VPS
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
pre-up iptables-restore < /etc/iptables.rules
source /etc/network/interfaces.d/*
iptables netplan
add a comment |
I used pre-up in /etc/network/interfaces. It's strange, I have two Ubuntu server, one a PC and another a VPS. This method works on my PC but not on my VPS.
This is the /etc/network/interfaces on my PC
# ifupdown has been replaced by netplan(5) on this system. See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
# sudo apt install ifupdown
auto dsl-provider
iface dsl-provider inet ppp
pre-up /bin/ip link set eno1 up # line maintained by pppoeconf
provider dsl-provider
#auto eno1
#iface eno1 inet manual
pre-up iptables-restore < /etc/iptables.rules
This is the /etc/network/interfaces on my VPS
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
pre-up iptables-restore < /etc/iptables.rules
source /etc/network/interfaces.d/*
iptables netplan
I used pre-up in /etc/network/interfaces. It's strange, I have two Ubuntu server, one a PC and another a VPS. This method works on my PC but not on my VPS.
This is the /etc/network/interfaces on my PC
# ifupdown has been replaced by netplan(5) on this system. See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
# sudo apt install ifupdown
auto dsl-provider
iface dsl-provider inet ppp
pre-up /bin/ip link set eno1 up # line maintained by pppoeconf
provider dsl-provider
#auto eno1
#iface eno1 inet manual
pre-up iptables-restore < /etc/iptables.rules
This is the /etc/network/interfaces on my VPS
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
pre-up iptables-restore < /etc/iptables.rules
source /etc/network/interfaces.d/*
iptables netplan
iptables netplan
asked Feb 18 at 15:34
Tom HsiungTom Hsiung
61
61
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Netplan does not support hook scripts:
https://netplan.io/faq#use-pre-up-post-up-etc-hook-scripts
The workaround is to use networkd-dispatcher. The above FAQ gives an example on how to do it.
The following is an example of using networkd-dispatcher to run existing ifup hooks via a script installed in /etc/networkd-dispatcher/routable.d/50-ifup-hooks:
#!/bin/sh
for d in up post-up; do
hookdir=/etc/network/if-$d.d
[ -e $hookdir ] && /bin/run-parts $hookdir
done
exit 0
Similarly, here is an example of an ifdown hook installed in /etc/networkd-dispatcher/off.d/50-ifdown-hooks:
#!/bin/sh
for d in down post-down; do
hookdir=/etc/network/if-$d.d
[ -e $hookdir ] && /bin/run-parts $hookdir
done
exit 0
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1119257%2fhow-to-load-saved-iptables-rules-on-rebooting%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Netplan does not support hook scripts:
https://netplan.io/faq#use-pre-up-post-up-etc-hook-scripts
The workaround is to use networkd-dispatcher. The above FAQ gives an example on how to do it.
The following is an example of using networkd-dispatcher to run existing ifup hooks via a script installed in /etc/networkd-dispatcher/routable.d/50-ifup-hooks:
#!/bin/sh
for d in up post-up; do
hookdir=/etc/network/if-$d.d
[ -e $hookdir ] && /bin/run-parts $hookdir
done
exit 0
Similarly, here is an example of an ifdown hook installed in /etc/networkd-dispatcher/off.d/50-ifdown-hooks:
#!/bin/sh
for d in down post-down; do
hookdir=/etc/network/if-$d.d
[ -e $hookdir ] && /bin/run-parts $hookdir
done
exit 0
add a comment |
Netplan does not support hook scripts:
https://netplan.io/faq#use-pre-up-post-up-etc-hook-scripts
The workaround is to use networkd-dispatcher. The above FAQ gives an example on how to do it.
The following is an example of using networkd-dispatcher to run existing ifup hooks via a script installed in /etc/networkd-dispatcher/routable.d/50-ifup-hooks:
#!/bin/sh
for d in up post-up; do
hookdir=/etc/network/if-$d.d
[ -e $hookdir ] && /bin/run-parts $hookdir
done
exit 0
Similarly, here is an example of an ifdown hook installed in /etc/networkd-dispatcher/off.d/50-ifdown-hooks:
#!/bin/sh
for d in down post-down; do
hookdir=/etc/network/if-$d.d
[ -e $hookdir ] && /bin/run-parts $hookdir
done
exit 0
add a comment |
Netplan does not support hook scripts:
https://netplan.io/faq#use-pre-up-post-up-etc-hook-scripts
The workaround is to use networkd-dispatcher. The above FAQ gives an example on how to do it.
The following is an example of using networkd-dispatcher to run existing ifup hooks via a script installed in /etc/networkd-dispatcher/routable.d/50-ifup-hooks:
#!/bin/sh
for d in up post-up; do
hookdir=/etc/network/if-$d.d
[ -e $hookdir ] && /bin/run-parts $hookdir
done
exit 0
Similarly, here is an example of an ifdown hook installed in /etc/networkd-dispatcher/off.d/50-ifdown-hooks:
#!/bin/sh
for d in down post-down; do
hookdir=/etc/network/if-$d.d
[ -e $hookdir ] && /bin/run-parts $hookdir
done
exit 0
Netplan does not support hook scripts:
https://netplan.io/faq#use-pre-up-post-up-etc-hook-scripts
The workaround is to use networkd-dispatcher. The above FAQ gives an example on how to do it.
The following is an example of using networkd-dispatcher to run existing ifup hooks via a script installed in /etc/networkd-dispatcher/routable.d/50-ifup-hooks:
#!/bin/sh
for d in up post-up; do
hookdir=/etc/network/if-$d.d
[ -e $hookdir ] && /bin/run-parts $hookdir
done
exit 0
Similarly, here is an example of an ifdown hook installed in /etc/networkd-dispatcher/off.d/50-ifdown-hooks:
#!/bin/sh
for d in down post-down; do
hookdir=/etc/network/if-$d.d
[ -e $hookdir ] && /bin/run-parts $hookdir
done
exit 0
answered 1 hour ago
whbogadowhbogado
1012
1012
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1119257%2fhow-to-load-saved-iptables-rules-on-rebooting%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown