Es importante tener muy claro el escenario que vamos a configurar en este caso, porque es un poco particular. Esta es una evolución de la entrada anterior: Servidor Ubuntu como AP wifi y Mikrotik como servidor DHCP
Hay un servidor con Ubuntu 16.04 que ofrece servicio wifi como AP. La interfaz wifi está en modo bridge con el puerto ethernet y envía todo el tráfico a la pasarela Mikrotik, donde hay un servidor DHCP que se encarga de dar dirección IP a los clientes wifi.
Empecemos configurando el bridge en el servidor Ubuntu. Archivo "/etc/network/interfaces":
source /etc/network/interfaces.d/*
auto lo br0
iface lo inet loopback
#ethernet interface
allow-hotplug enp2s0
iface enp2s0 inet manual
#wifi interface
allow-hotplug wlp3s0
iface wlp3s0 inet manual
# Setup bridge
iface br0 inet static
bridge_ports enp2s0
address 192.168.2.2
netmask 255.255.255.0
network 192.168.2.0
Prestad atención a "bridge_ports": la interfaz wifi no se añade a la lista, y esto es porque hasta que el hostapd no está en marcha no tiene sentido hacerlo. Veréis la opción "bridge=br0" en hostapd.conf, que arreglará ese mal comportamiento.
Configuración del AP wifi, "/etc/default/hostapd":
DAEMON_CONF="/etc/hostapd/hostapd.conf"
y "/etc/hostapd/hostapd.conf":
bridge=br0 # bridge interface
interface=wlp3s0 # wifi interface name
driver=nl80211
ssid=the_ssid_name # name of your network
hw_mode=g
channel=1
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=3
wpa_passphrase=the_secret_key # secret key to joing with the wifi network
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
logger_syslog=-1
logger_syslog_level=3
logger_stdout=-1
logger_stdout_level=1
Configuración del servidor DHCP en el Mikrotik:
# setting the interface address, in my case ether4
/ip address
add address=192.168.2.1/24 interface=ether4 network=192.168.2.0
# setting up DHCP on interface 4 of the mikrotik device
/ip dhcp-server
add address-pool=dhcp-pool disabled=no interface=ether4 name=dhcp-pool
# network of the DHCP server
/ip dhcp-server network
add address=192.168.2.1.0/24 dns-server=8.8.8.8 domain=your_network.local gateway=192.168.2.1 netmask=24
# IP pool used by the DHCP server
/ip pool
add name=dhcp-pool ranges=192.168.2.65-192.168.2.70