LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-08-2018, 01:39 AM   #1
tuxthegreat
Member
 
Registered: Mar 2018
Distribution: Ubuntu Mate, OSX, Win10, ODROID-N2+
Posts: 176

Rep: Reputation: Disabled
Need to reload ufw after each restart to apply rules


This effects 2 Ubuntu Mate 16.04.4 installs. One is on a laptop and the other is on a miniboard-computer, the Odroid-C2. Some time ago I noticed that after each reboot I was unable to ssh into my laptop nor my Odroid, this perplexed me as I haven't changed any iptables / UFW firewall rules. Internet works, as in the browser connects just fine, but other programs which rely on open ports such as ssh, ftp server and others can't function until I reload ufw
Code:
sudo ufw reload
I am guessing that a network or a kernel update some time ago, maybe 4-5 weeks ? has caused this issue. Is there a way to automate this command upon restart, either before or after the login name/password screen as sometimes I like to start up one of my Ubuntu installs and just use ssh without logging in via gui.
 
Old 05-08-2018, 06:30 PM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
/path/to/ufw reload
in /etc/rc.local

or iptables-persistent ??

http://bit.ly/2jJsQoI
 
Old 05-08-2018, 09:00 PM   #3
tuxthegreat
Member
 
Registered: Mar 2018
Distribution: Ubuntu Mate, OSX, Win10, ODROID-N2+
Posts: 176

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
/path/to/ufw reload
in /etc/rc.local

or iptables-persistent ??

http://bit.ly/2jJsQoI
iptables-persistent I have tried to install many times but failed, I will try the first suggestion
Code:
/etc/init.d/ufw restart
and report back Thank you for your reply.
It did work, but after a 3 minute delay. Is that normal, rc.local kicks in a few minutes after login?

Last edited by tuxthegreat; 05-08-2018 at 09:21 PM.
 
Old 05-09-2018, 11:16 AM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
I wouldn't say minutes.
immediately after sysinit or whatever.
When the services have all had their chance to start,
/etc/r.local is last.
Runs at System-level

https://help.ubuntu.com/community/IptablesHowTo
How many rules you have? It could be "busy" if here are many.

https://help.ubuntu.com/community/UFW
 
Old 05-10-2018, 04:58 AM   #5
tuxthegreat
Member
 
Registered: Mar 2018
Distribution: Ubuntu Mate, OSX, Win10, ODROID-N2+
Posts: 176

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
I wouldn't say minutes.
immediately after sysinit or whatever.
When the services have all had their chance to start,
/etc/r.local is last.
Runs at System-level

https://help.ubuntu.com/community/IptablesHowTo
How many rules you have? It could be "busy" if here are many.

https://help.ubuntu.com/community/UFW
Yeah you're correct, I am able to ssh after I log in using the port I assigned to my ssh server. Also other applications which require ports to be opened work as well.
 
Old 05-11-2018, 12:15 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
glad t worked out!
 
  


Reply

Tags
ftp, iptables, ssh access, ubuntu 16.04, ufw



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ufw rules suddenly stopped working ? netpumber Linux - Server 2 04-20-2017 02:13 AM
[SOLVED] Creating Custom SSH iptable rules for use with UFW akamikeym Linux - Security 14 03-02-2011 02:41 AM
Apache reload vs. restart sfjoe Linux - Server 5 12-08-2008 12:23 PM
How to reload /etc/my.cnf without restart mysqld? Chowroc Linux - Software 4 01-16-2006 11:52 AM
Automating firewall reload on i/f (ppp) restart aelms Linux - Security 0 10-25-2003 02:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration