carles
November 27, 2020, 10:35am
1
I have setup a new hAP ac2 router in my office. Everything works fine, including OpenVPN, but DHCP clients, sometimes, get IP not from my router but from a DHCP located in the WAN server.
The basic parameters of my router are:
LAN IP ADDRESS: 192.168.1.1/24
WAN IP ADDRESS: 10.59.0.46/24
DHCP RANGE IP: 192.168.1.200-254
How can I avoid clients get IP from an external DHCP?
mkx
November 27, 2020, 10:59am
2
By properly configuring your hAP ac2. Since you didn’t post configuration, we can’t say what’s wrong. So execute /export hide-sensitive file=anynameyouwish from terminal window, fetch the name and post the contents here (inside [__code] [/code] block).
anav
November 27, 2020, 11:52am
3
mkx awarded level 1 of MTUNA certification!
mkx
November 27, 2020, 2:23pm
4
I’m glad our one and only MTUNA instructor (and guru) approves
carles
November 27, 2020, 3:02pm
5
Sorry mkx. Here is the config:
# nov/27/2020 16:00:08 by RouterOS 6.44.5
# software id = YH18-J680
#
# model = RBD52G-5HacD2HnD
# serial number = CB380BEA31D6
/interface bridge
add admin-mac=C4:AD:34:C4:58:B4 auto-mac=no comment=defconf name=bridge
/interface ethernet
set [ find default-name=ether2 ] arp=proxy-arp
set [ find default-name=ether3 ] arp=proxy-arp
set [ find default-name=ether4 ] arp=proxy-arp
set [ find default-name=ether5 ] arp=proxy-arp
/interface wireless
set [ find default-name=wlan1 ] antenna-gain=3 arp=proxy-arp band=2ghz-b/g/n \
channel-width=20/40mhz-XX country=spain disabled=no distance=indoors \
frequency=auto frequency-mode=regulatory-domain installation=indoor mode=\
ap-bridge name=Elfos+_2G ssid=Elfos+_2G wireless-protocol=802.11
set [ find default-name=wlan2 ] antenna-gain=3 arp=proxy-arp band=5ghz-a/n/ac \
channel-width=20/40/80mhz-XXXX country=spain disabled=no distance=indoors \
frequency=auto frequency-mode=regulatory-domain installation=indoor mode=\
ap-bridge name=Elfos+_5G ssid=Elfos+_5G wireless-protocol=802.11
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] authentication-types=wpa2-psk eap-methods="" mode=\
dynamic-keys supplicant-identity=MikroTik
/ip pool
add name=dhcp ranges=192.168.1.10-192.168.1.49
add name=vpn_pool ranges=192.168.89.2-192.168.89.10
add name=dhcp_pool2 ranges=192.168.1.200-192.168.1.254
/ip dhcp-server
add address-pool=dhcp_pool2 disabled=no interface=bridge name=dhcp1
/ppp profile
set *FFFFFFFE change-tcp-mss=default local-address=192.168.89.1 \
remote-address=vpn_pool
/interface bridge port
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
add bridge=bridge comment=defconf interface=Elfos+_2G
add bridge=bridge comment=defconf interface=Elfos+_5G
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface l2tp-server server
set use-ipsec=yes
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
/interface ovpn-server server
set auth=sha1 certificate=SERVER cipher=aes256 enabled=yes \
require-client-certificate=yes
/interface sstp-server server
set default-profile=default-encryption
/ip address
add address=192.168.1.1/24 comment=defconf interface=bridge network=\
192.168.1.0
add address=10.59.0.46/24 interface=ether1 network=10.59.0.0
/ip cloud
set ddns-enabled=yes
/ip dhcp-client
add comment=defconf dhcp-options=hostname,clientid interface=ether1
/ip dhcp-server network
add address=192.168.1.0/24 comment=defconf dns-server=8.8.8.8 gateway=\
192.168.1.1 netmask=24
/ip dns
set allow-remote-requests=yes servers=8.8.8.8
/ip dns static
add address=192.168.1.1 name=router.lan
/ip firewall filter
add action=accept chain=input comment="allow OpenVPN" dst-port=1194 protocol=\
tcp
add action=accept chain=input comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=accept chain=input comment="allow IPsec NAT" dst-port=4500 \
protocol=udp
add action=accept chain=input comment="allow IKE" dst-port=500 protocol=udp
add action=accept chain=input comment="allow l2tp" dst-port=1701 protocol=udp
add action=accept chain=input comment="allow pptp" dst-port=1723 protocol=tcp
add action=accept chain=input comment="allow sstp" dst-port=443 protocol=tcp
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" \
ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related
add action=accept chain=forward comment=\
"defconf: accept established,related, untracked" connection-state=\
established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" \
connection-state=invalid
add action=drop chain=forward comment=\
"defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
connection-state=new in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" \
ipsec-policy=out,none out-interface-list=WAN
add action=masquerade chain=srcnat comment="masq. vpn traffic" src-address=\
192.168.89.0/24
/ip route
add distance=1 gateway=10.59.0.254
/ppp secret
add name=mia profile=default-encryption service=ovpn
add name=anna profile=default-encryption service=ovpn
/system clock
set time-zone-name=Europe/Madrid
/system identity
set name=Elfos
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
mkx
November 27, 2020, 3:20pm
6
Any particular reason for all bridge interfaces having proxy-arp set?
Why do you have both static IP address set and DHCP client running on ether1 interface?
carles
November 30, 2020, 8:30am
7
Thanks mkx, I have no idea why ehternet interfaces had arp-proxy enabled, but after changing ARP option to just “enabled”, it worked as expected.
I have also disabled DHCP client on ehter1 interface.
Thank you very very much
carles
November 30, 2020, 8:53am
8
I’m sorry, but I have realised that wireless clients keep getting IP from outer DHCP server.
Both Wireless and Ehternet interfaces have the ARP setting to Enabled.
# nov/30/2020 09:50:31 by RouterOS 6.44.5
# software id = YH18-J680
#
# model = RBD52G-5HacD2HnD
# serial number = CB380BEA31D6
/interface bridge
add admin-mac=C4:AD:34:C4:58:B4 auto-mac=no comment=defconf name=bridge
/interface wireless
set [ find default-name=wlan1 ] antenna-gain=3 band=2ghz-b/g/n channel-width=\
20/40mhz-XX country=spain disabled=no distance=indoors frequency=auto \
frequency-mode=regulatory-domain installation=indoor mode=ap-bridge name=\
Elfos+_2G ssid=Elfos+_2G wireless-protocol=802.11
set [ find default-name=wlan2 ] antenna-gain=3 band=5ghz-a/n/ac \
channel-width=20/40/80mhz-XXXX country=spain disabled=no distance=indoors \
frequency=auto frequency-mode=regulatory-domain installation=indoor mode=\
ap-bridge name=Elfos+_5G ssid=Elfos+_5G wireless-protocol=802.11
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] authentication-types=wpa2-psk eap-methods="" mode=\
dynamic-keys supplicant-identity=MikroTik
/ip hotspot profile
set [ find default=yes ] html-directory=flash/hotspot
/ip pool
add name=dhcp ranges=192.168.1.10-192.168.1.49
add name=vpn_pool ranges=192.168.89.2-192.168.89.10
add name=dhcp_pool2 ranges=192.168.1.200-192.168.1.254
/ip dhcp-server
add address-pool=dhcp_pool2 disabled=no interface=bridge name=dhcp1
/ppp profile
set *FFFFFFFE change-tcp-mss=default local-address=192.168.89.1 \
remote-address=vpn_pool
/interface bridge port
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
add bridge=bridge comment=defconf interface=Elfos+_2G
add bridge=bridge comment=defconf interface=Elfos+_5G
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface l2tp-server server
set use-ipsec=yes
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
/interface ovpn-server server
set auth=sha1 certificate=SERVER cipher=aes256 enabled=yes \
require-client-certificate=yes
/interface sstp-server server
set default-profile=default-encryption
/ip address
add address=192.168.1.1/24 comment=defconf interface=bridge network=\
192.168.1.0
add address=10.59.0.46/24 interface=ether1 network=10.59.0.0
/ip cloud
set ddns-enabled=yes
/ip dhcp-server network
add address=192.168.1.0/24 comment=defconf dns-server=8.8.8.8 gateway=\
192.168.1.1 netmask=24
/ip dns
set allow-remote-requests=yes servers=8.8.8.8
/ip dns static
add address=192.168.1.1 name=router.lan
/ip firewall filter
add action=accept chain=input comment="allow OpenVPN" dst-port=1194 protocol=\
tcp
add action=accept chain=input comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=accept chain=input comment="allow IPsec NAT" dst-port=4500 \
protocol=udp
add action=accept chain=input comment="allow IKE" dst-port=500 protocol=udp
add action=accept chain=input comment="allow l2tp" dst-port=1701 protocol=udp
add action=accept chain=input comment="allow pptp" dst-port=1723 protocol=tcp
add action=accept chain=input comment="allow sstp" dst-port=443 protocol=tcp
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" \
ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related
add action=accept chain=forward comment=\
"defconf: accept established,related, untracked" connection-state=\
established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" \
connection-state=invalid
add action=drop chain=forward comment=\
"defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
connection-state=new in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" \
ipsec-policy=out,none out-interface-list=WAN
add action=masquerade chain=srcnat comment="masq. vpn traffic" src-address=\
192.168.89.0/24
/ip route
add distance=1 gateway=10.59.0.254
/ppp secret
add name=mia profile=default-encryption service=ovpn
add name=anna profile=default-encryption service=ovpn
/system clock
set time-zone-name=Europe/Madrid
/system identity
set name=Elfos
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
mkx
November 30, 2020, 9:19am
9
I’ve no idea why wireless clients would behave differently than wired clients in this aspect. You may want to perform a good cold boot of router to make sure everything is set according to setup …