Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introdução

 

 

 

Anchor
netplan
netplan
Configuração utilizando: Netplan

Exemplo de Arquivo de configuração de redes utilizando netplan, no Ubuntu Server 18.

...

Code Block
themeMidnight
languagebash
netplan apply

 

Anchor
ifupdown
ifupdown
Configuração utilizando: ifupdown

 

Ao utilizar o ifupdown é possível reaproveitar as configurações do /etc/network/interfaces. Para que o uso do ifupdown seja feito com sucesso, realize os seguintes procedimentos:

...

Edite o arquivo interfaces.

 

Code Block
themeMidnight
languagebash
vim /etc/network/interfaces

...

Note
É importante remapear as interfaces de acordo com as novas notações.
Code Block
themeMidnight
languagebash
auto lo

iface lo inet loopback


auto br_giga

iface br_giga inet dhcp

bridge_ports eth0.20

bridge-stp off

bridge-maxwait 2


auto br_internet

iface br_internet inet static

address 177.125.143.8

netmask 255.255.255.224

dns-nameservers 177.125.142.47 8.8.8.8 8.8.4.4

gateway 177.125.143.1

bridge_ports eth0.30

bridge-stp off

bridge-maxwait 2


auto br_control

iface br_control inet static

bridge_ports eth0.10

bridge-stp off

bridge-maxwait 2

address 10.138.0.30

netmask 255.255.0.0

dns-nameservers 10.138.0.80 8.8.8.8 8.8.4.4

post-up ip route add 10.0.0.0/8 via 10.138.0.1


auto br_cmc

iface br_cmc inet static

bridge_ports eth0.5

bridge-stp off

bridge-maxwait 2

address 172.16.138.30

netmask 255.255.255.0


auto br_exp1

iface br_exp1 inet manual

bridge_ports eth2

bridge-stp off

bridge-maxwait 2


auto br_exp2

iface br_exp2 inet manual

bridge_ports eth3

bridge-stp off

bridge-maxwait 2


auto br_exp3

iface br_exp3 inet manual

bridge_ports eth1

bridge-stp off

bridge-maxwait 2

 

 

Aplicadas as configurações do ifupdown, recomendamos reiniciar o servidor.

 

...

Anchor
internet
internet
Habilitar Internet para VMs

 Para habilitar a Internet para as VMs, recomendamos os seguintes procedimentos.


Método provisório:

 

...

Code Block
themeMidnight
languagebash
echo 1 > /proc/sys/net/ipv4/ip_forward

...


iptables -t nat -A POSTROUTING -s 10.XXX.0.0/16 -o br_internet -j MASQUERADE

 

Note
Aonde XXX é o ID da ilha.