Differences

This shows you the differences between two versions of the page.

Link to this comparison view

rl:labs:08:contents:01 [2025/11/23 12:18]
eduard.dumistracel [01. [10p] Configurare translatare de adrese (MASQUERADE)]
rl:labs:08:contents:01 [2025/11/28 11:22] (current)
radu.mantu
Line 25: Line 25:
 </​code>​ </​code>​
  
-Vrem să verificăm configurarea corectă a NAT. Pentru acesta vom trimite de pe stația ''​red''​ un pachet către ''​8.8.8.8''​. Pachetul va trece prin gateway (adică stația ''​host''​) și va fi translatat. Pe stația ''​red''​ rulăm comanda<​code bash> +Vrem să verificăm configurarea corectă a NAT. Pentru acesta vom trimite de pe stația ''​red''​ un pachet către ''​1.1.1.1''​. Pachetul va trece prin gateway (adică stația ''​host''​) și va fi translatat. Pe stația ''​red''​ rulăm comanda<​code bash> 
-root@red:~# ping -c 2 8.8.8.8 +root@red:~# ping -c 2 1.1.1.1 
-PING 8.8.8.(8.8.8.8) 56(84) bytes of data.+PING 1.1.1.(1.1.1.1) 56(84) bytes of data.
 From 192.168.1.2 icmp_seq=1 Destination Host Unreachable From 192.168.1.2 icmp_seq=1 Destination Host Unreachable
 From 192.168.1.2 icmp_seq=2 Destination Host Unreachable From 192.168.1.2 icmp_seq=2 Destination Host Unreachable
  
---- 8.8.8.ping statistics ---+--- 1.1.1.ping statistics ---
 2 packets transmitted,​ 0 received, +2 errors, 100% packet loss, time 999ms 2 packets transmitted,​ 0 received, +2 errors, 100% packet loss, time 999ms
 </​code>​ </​code>​
  
-Observăm că nu există conectivitate de la stația ''​red''​ către adresa IP ''​8.8.8.8''​. Consultăm întreaga tabelă ''​nat'':<​code bash>+Observăm că nu există conectivitate de la stația ''​red''​ către adresa IP ''​1.1.1.1''​. Consultăm întreaga tabelă ''​nat'':<​code bash>
 root@host:​~#​ iptables -t nat -L -n -v root@host:​~#​ iptables -t nat -L -n -v
 Chain PREROUTING (policy ACCEPT 2 packets, 168 bytes) Chain PREROUTING (policy ACCEPT 2 packets, 168 bytes)
Line 60: Line 60:
 </​code>​ </​code>​
  
-Intrăm din nou pe stația ''​red''​ și folosim ''​ping''​ pentru a testa conectivitatea la adresa IP ''​8.8.8.8'':<​code bash> +Intrăm din nou pe stația ''​red''​ și folosim ''​ping''​ pentru a testa conectivitatea la adresa IP ''​1.1.1.1'':<​code bash> 
-root@red:~# ping -c 2 8.8.8.8 +root@red:~# ping -c 2 1.1.1.1 
-PING 8.8.8.(8.8.8.8) 56(84) bytes of data. +PING 1.1.1.(1.1.1.1) 56(84) bytes of data. 
-64 bytes from 8.8.8.8: icmp_req=1 ttl=61 time=92.9 ms +64 bytes from 1.1.1.1: icmp_req=1 ttl=61 time=92.9 ms 
-64 bytes from 8.8.8.8: icmp_req=2 ttl=61 time=81.2 ms+64 bytes from 1.1.1.1: icmp_req=2 ttl=61 time=81.2 ms
  
---- 8.8.8.ping statistics ---+--- 1.1.1.ping statistics ---
 2 packets transmitted,​ 2 received, 0% packet loss, time 1001ms 2 packets transmitted,​ 2 received, 0% packet loss, time 1001ms
 rtt min/​avg/​max/​mdev = 81.272/​87.094/​92.917/​5.829 ms rtt min/​avg/​max/​mdev = 81.272/​87.094/​92.917/​5.829 ms
rl/labs/08/contents/01.txt · Last modified: 2025/11/28 11:22 by radu.mantu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0