Ubuntu 16.04 Port forwading troooble 2 x NIC

0

Estou tentando configurar um gateway / firewall entre o nosso roteador e a rede do Windows AD! Eu segui um monte de instruções e tutoriais na web, mas ainda estou faltando alguma coisa, como eu não consigo acesso à INTERNET a partir da rede interna (Windows) para passar pela Caixa Linus!

Existem 2 adaptadores Ethernet na caixa ... Ambos possuem IPs estáticos, pois ambos os lados da rede são configurados usando esta configuração.

Internal NIC enp3s0 ...11.0.0.2 (255.255.255.0)
External NIC enp2s0 ...10.0.0.3 (255.255.255.0)

Some things i can do! 

1) I can... from the internal network ping any of those IP's Above! enp3s0 is directly attached to the internal network and enp2s0 is INTERNET facing (DSL Router)

Here is some more info! 

Any pointers will be much appreciated !

enp2s0    Link  encap:Ethernet   HWaddr  c4:12:f5:31:84:40  
          inet  addr:10.0.0.3   Bcast:10.0.0.255   Mask:255.255.255.0
          inet6  addr:  fe80::cd1a:d428:fd52:1ad2/64  Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13371 errors:0 dropped:0 overruns:0 frame:0
          TX packets:13400 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:7781316 (7.7 MB)  TX bytes:1791327 (1.7 MB)

enp3s0    Link  encap:Ethernet   HWaddr  00:30:67:2d:27:18  
          inet  addr:11.0.0.2   Bcast:11.0.0.255   Mask:255.255.255.0
          inet6  addr:  fe80::d24b:38b2:cb59:4e3f/64  Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:870 errors:0 dropped:0 overruns:0 frame:0
          TX packets:190 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:63526 (63.5 KB)  TX bytes:15403 (15.4 KB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:3239 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3239 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:375798 (375.7 KB)  TX bytes:375798 (375.7 KB)

-----------------------------------------------------------------------------

Kernel IP routing table

Destination      Gateway          Genmask          Flags Metric Ref     Use  Iface

0.0.0.0          10.0.0.2         0.0.0.0          UG     100     0         0  enp2s0

0.0.0.0          10.0.0.3         0.0.0.0          UG     101     0         0  enp3s0

10.0.0.0         0.0.0.0          255.255.255.0    U      100     0         0  enp2s0

10.0.0.3         0.0.0.0          255.255.255.255  UH     100     0         0  enp3s0

11.0.0.0         0.0.0.0          255.255.255.0    U      100     0         0  enp3s0

169.254.0.0      0.0.0.0          255.255.0.0      U      1000    0         0  enp2s0
    
por Hemroiditis 06.06.2016 / 22:33

1 resposta

0

Você deve executar este comando para rotear pacotes da rede interna para a interface externa via iptables .

iptables -t nat -A POSTROUTING -s 11.0.0.0/24 -o enp2s0 -j MASQUERADE

também abre /etc/sysctl.conf e
altere net.ipv4.ip_forward=0 para net.ipv4.ip_forward=1 .

digite este comando:

sysctl -p
    
por Ghasem Pahlavan 06.06.2016 / 23:32