Como definir o NAT pelo ufw no Ubuntu 16.04?

0

Eu sou verde para o Ubuntu. Eu tentei o método de " ufw Masquerading " para definir o NAT. Mas não consigo conectar a Internet através do NAT com o MacBook Air.

Aqui estão as informações que usei para conectar a Internet:

IP : 192.168.1.2

mask : 255.255.255.0

router : blank

E aqui está meu /etc/ufw/before.rules

 #
 # rules.before
 #
 # Rules that should be run before the ufw command line added rules. Custom
 # rules should be added to one of these chains:
 #   ufw-before-input
 #   ufw-before-output
 #   ufw-before-forward
 #

 # NAT table rules
 *nat
 :POSTROUTING ACCEPT [0:0]

 # Forward traffic through eno1
 -A POSTROUTING -s 192.168.1.0/24 -o eno1 -j MASQUERADE
 COMMIT

 # Don't delete these required lines, otherwise there will be errors
 *filter
 :ufw-before-input - [0:0]
 :ufw-before-output - [0:0]
 :ufw-before-forward - [0:0]

 (and so on...)

Obrigado a todos!

    
por Artis Tu 30.03.2018 / 13:57

0 respostas