LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Containers
User Name
Password
Linux - Containers This forum is for the discussion of all topics relating to Linux containers. Docker, LXC, LXD, runC, containerd, CoreOS, Kubernetes, Mesos, rkt, and all other Linux container platforms are welcome.

Notices


Reply
  Search this Thread
Old 05-27-2020, 05:17 AM   #1
LXCnut
LQ Newbie
 
Registered: May 2020
Posts: 24

Rep: Reputation: Disabled
Unable to ap-get when UFW is running on pve proxmox node


Hello,

When i have the ufw for the pve node active, the container is unable to apt-get update or any apt-get install. When I disable the ufw for the pve node, apt-get works very fine.

I want the ufw to be up and running to boost security. I have also tried to enable various ports in the pve node ufw but it doesnt seem to do any good.
 
Old 05-27-2020, 03:00 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,020

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
Then you need to look up what ports/protocol are used in apt (apt-get) and temporarily open. https://superuser.com/questions/1207...to-get-updates

I guess your firewall could be a layer 7+ but that is a different deal.
 
Old 05-28-2020, 05:21 AM   #3
LXCnut
LQ Newbie
 
Registered: May 2020
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jefro View Post
Then you need to look up what ports/protocol are used in apt (apt-get) and temporarily open. https://superuser.com/questions/1207...to-get-updates

I guess your firewall could be a layer 7+ but that is a different deal.
I have tried opening port 53 but the issue is still there
 
Old 05-28-2020, 07:03 AM   #4
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Rep: Reputation: 103Reputation: 103
If you're not going to show us anything concrete, there's no way anyone can help you. If you say you've opened port 53, then the answer is: then it should works and that's that.

Show us the current rules and the actual commands you've run, one after another, to actually understand what's going on.

Last edited by vincix; 05-28-2020 at 08:09 AM.
 
Old 05-28-2020, 08:51 AM   #5
LXCnut
LQ Newbie
 
Registered: May 2020
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by vincix View Post
If you're not going to show us anything concrete, there's no way anyone can help you. If you say you've opened port 53, then the answer is: then it should works and that's that.

Show us the current rules and the actual commands you've run, one after another, to actually understand what's going on.
sudo ufw enable //to enable the firewall for both the pve_node and the container

sudo ufw allow 53/tcp //to enable port 53 for both the pve_node and the container. Other ports open are http, https, ntp, ftp, 8006, 53

sudo ufw status [active] //when the pve_node ufw is active, I cannot update or install anything via apt-get on the LXC container. Container ID 100

sudo ufw status [disable] //when the pve_node ufw is disabled, I can apt-get update on the container and I can apt-get install on the container too

Is that a bit more clear!?
 
Old 05-28-2020, 08:54 AM   #6
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Rep: Reputation: 103Reputation: 103
Yes, this is a bit clearer, now that you're unjustifiably annoyed. Now we see that you're trying to connect to DNS through TCP instead of UDP. DNS works mainly with UDP (and in special cases only with TCP).
But I guess I could see that only after you've pasted your commands, couldn't I?
 
Old 05-29-2020, 02:39 AM   #7
LXCnut
LQ Newbie
 
Registered: May 2020
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by vincix View Post
Yes, this is a bit clearer, now that you're unjustifiably annoyed. Now we see that you're trying to connect to DNS through TCP instead of UDP. DNS works mainly with UDP (and in special cases only with TCP).
But I guess I could see that only after you've pasted your commands, couldn't I?
$sudo ufw allow 53/udp //still does not work. apt-get update and apt-get install still dont work with this port allowed
 
Old 05-29-2020, 03:09 AM   #8
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Rep: Reputation: 103Reputation: 103
Ok, so that means there are probably more things to fix.
What do the following commands show?
Code:
iptables -vnL --line-numbers
iptables -t nat -vnL --line-numbers
 
Old 06-04-2020, 06:57 AM   #9
LXCnut
LQ Newbie
 
Registered: May 2020
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by vincix View Post
Ok, so that means there are probably more things to fix.
What do the following commands show?
Code:
iptables -vnL --line-numbers
iptables -t nat -vnL --line-numbers
I think I just realized what the issue is. With proxmox (Proxmox Virtual Environment), the node is the one which feeds the host (container) with settings. Most of the settings from the container pick from the host node. As a security measure, the debian apt-get update URL is by default disabled in proxmox and updates are expected to be run from the GUI. So even from the node apt-get update runs a little and then hits an error. I am seeing that it may not have anything to do with the ports. But since it is a security measure that it is disabled by default, I am opting not to interfere with it. And also I won't be installing much via apt-get. When there is need I will just be doing a normal server upgrade / update and disabling UFW once in a while. There are other security variables I have set up, so it wont be too bad disabling it once in a while for maintenance
 
Old 06-05-2020, 02:49 PM   #10
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Rep: Reputation: 103Reputation: 103
Hi,

I've used proxmox myself for some time and what you're saying cannot possibly be right, that they expect you to run the updates through the GUI. You run the updates through apt/apt-get on the command line. This is how it works. I don't think you actually can run them from the GUI at all, I'd be really curious to see how.

Are you maybe confusing the enterprise repository-related error with a security measure? By default proxmox enables these repositories to which you don't have accesss if you don't have a licence. You have to manually enable the no-subscription repository.

I don't think a security measure that denies access to updates through the command line while enabling them on the GUI makes much sense. If anything, it would be the opposite.
 
Old 07-01-2020, 06:14 AM   #11
LXCnut
LQ Newbie
 
Registered: May 2020
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by vincix View Post
Hi,

I've used proxmox myself for some time and what you're saying cannot possibly be right, that they expect you to run the updates through the GUI. You run the updates through apt/apt-get on the command line. This is how it works. I don't think you actually can run them from the GUI at all, I'd be really curious to see how.

Are you maybe confusing the enterprise repository-related error with a security measure? By default proxmox enables these repositories to which you don't have accesss if you don't have a licence. You have to manually enable the no-subscription repository.

I don't think a security measure that denies access to updates through the command line while enabling them on the GUI makes much sense. If anything, it would be the opposite.
hehe you so serious man... the linux way is normally the calm way. I think its because with linux you just learn something new everyday, I don't think there is a linux professional out there who knows it all! Thanks though...
 
Old 07-02-2020, 03:55 AM   #12
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Rep: Reputation: 103Reputation: 103
I've no idea what you're talking about, but I'd have preferred that you explained what you actually happened, instead of uttering clichés.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rhel 2 node cluster: resources do not move to second node when node halted tapuhi Linux - Software 1 03-01-2015 10:41 AM
node recovery when the node becomes fault by using another node to replace it jerinc Linux - Wireless Networking 0 02-21-2014 05:44 PM
How to transfer the services from node 1 to node 2 ,if node 1 is directly turned off sankarg304 Linux - Server 1 12-12-2012 10:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Containers

All times are GMT -5. The time now is 09:56 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