Interligando Redes Distintas Linux

Cenario:

PC1 <=> PC2

Configuração no PC1

ifconfig eth0 192.168.0.1
ifconfig eth0:0 10.0.0.2

Habilitando repasse de pacotes entre placas de rede

echo 1 > /proc/sys/net/ipv4/ip_forward

*Opcional: Compartilhar internet do PC1 para rede

iptables -t nat -A POSTROUTING -o $(ip route | awk '/default/ {print $5}') -j MASQUERADE

Configuração no PC2

ifconfig eth0 10.0.0.1
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s