Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
What services does nftables know the ports of?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
bulletbill22
n00b
n00b


Joined: 15 Oct 2022
Posts: 34

PostPosted: Thu Jul 11, 2024 7:17 pm    Post subject: What services does nftables know the ports of? Reply with quote

For example, to accept ssh, http, and https traffic you can use
Code:
tcp dport {ssh,http,https} accept
instead of using
Code:
tcp dport {22,80,443} accept
What other services can be named rather than using ports?
Back to top
View user's profile Send private message
pa4wdh
l33t
l33t


Joined: 16 Dec 2005
Posts: 882

PostPosted: Thu Jul 11, 2024 7:22 pm    Post subject: Reply with quote

nftables itself uses only port numbers, i expect (but did not check the code) it uses the system resolver for service names which uses /etc/services by default.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5104
Location: Bavaria

PostPosted: Thu Jul 11, 2024 9:11 pm    Post subject: Reply with quote

pa4wdh wrote:
nftables itself uses only port numbers, i expect (but did not check the code) it uses the system resolver for service names which uses /etc/services by default.

Yes ... the same is true for /etc/protocols ... so you can use names like TCP and UDP (instead of its numbers 6 and 17).
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum