AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / ubuntu / Perguntas / 1300136
Accepted
bomben
bomben
Asked: 2020-12-15 13:02:09 +0800 CST2020-12-15 13:02:09 +0800 CST 2020-12-15 13:02:09 +0800 CST

Alguém pode explicar essas regras para um usuário específico e uma VPN no iptables?

  • 772

Eu usei um script daqui para configurar regras que garantem que o usuário transmission-daemonsó possa enviar tráfego através da VPN que eu uso.

Pelo menos é o que diz o autor. Eu tenho problemas para entender a saída a seguir. Por exemplo, o que a linha tcp spt:9091 owner GID match debian-transmission significa? Por que não há tráfego nessa regra?

Dica: Minha porta Ethernet é enp3s0(como eth0).

$ sudo iptables -L -v
Chain INPUT (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
  436 35225 f2b-sshd   tcp  --  any    any     anywhere             anywhere             multiport dports ssh
 1085  221K ACCEPT     all  --  tun0   any     anywhere             anywhere            
 2913  923K ACCEPT     all  --  enp3s0 any     anywhere             anywhere            
  112 12221 ACCEPT     all  --  lo     any     anywhere             anywhere            

Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0            all  --  any    any     anywhere             anywhere            

Chain OUTPUT (policy ACCEPT 4540 packets, 1267K bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     tcp  --  any    enp3s0  anywhere             192.168.100.0/25     tcp spt:9091 owner GID match debian-transmission
    0     0 ACCEPT     udp  --  any    enp3s0  anywhere             192.168.100.0/25     udp spt:9091 owner GID match debian-transmission
 2263  202K ACCEPT     all  --  any    tun0    anywhere             anywhere             owner GID match debian-transmission
   12  2581 ACCEPT     all  --  any    lo      anywhere             anywhere             owner GID match debian-transmission
    0     0 REJECT     all  --  any    any     anywhere             anywhere             owner GID match debian-transmission reject-with icmp-port-unreachable
networking iptables vpn transmission
  • 1 1 respostas
  • 143 Views

1 respostas

  • Voted
  1. Best Answer
    Doug Smythies
    2020-12-15T13:38:01+08:002020-12-15T13:38:01+08:00

    a regra:

    iptables -A OUTPUT -d 192.168.100.0/25 -p tcp --sport 9091 -m owner --gid-owner debian-transmission -o enp3s0 -j ACCEPT
    

    irá ACEITAR o pacote SE for para qualquer IP no intervalo 192.168.100.0 - 192.168.100.127 E o protocolo for tcp E a porta de origem for 9091 E o proprietário do pacote for debian-transmission E for destinado à interface de rede enp3s0 ELSE go para a próxima regra do iptables.

    • 1

relate perguntas

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Existe um comando para listar todos os usuários? Também para adicionar, excluir, modificar usuários, no terminal?

    • 9 respostas
  • Marko Smith

    Como excluir um diretório não vazio no Terminal?

    • 4 respostas
  • Marko Smith

    Como descompactar um arquivo zip do Terminal?

    • 9 respostas
  • Marko Smith

    Como instalo um arquivo .deb por meio da linha de comando?

    • 11 respostas
  • Marko Smith

    Como instalo um arquivo .tar.gz (ou .tar.bz2)?

    • 14 respostas
  • Marko Smith

    Como listar todos os pacotes instalados

    • 24 respostas
  • Martin Hope
    Flimm Como posso usar o docker sem sudo? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    led-Zepp Como faço para salvar a saída do terminal em um arquivo? 2014-02-15 11:49:07 +0800 CST
  • Martin Hope
    ubuntu-nerd Como descompactar um arquivo zip do Terminal? 2011-12-11 20:37:54 +0800 CST
  • Martin Hope
    TheXed Como instalo um arquivo .deb por meio da linha de comando? 2011-05-07 09:40:28 +0800 CST
  • Martin Hope
    Ivan Como listar todos os pacotes instalados 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    David Barry Como determino o tamanho total de um diretório (pasta) na linha de comando? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher "Os seguintes pacotes foram retidos:" Por que e como resolvo isso? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford Como os PPAs podem ser removidos? 2010-07-30 01:09:42 +0800 CST

Hot tag

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve