Community discussions

MikroTik App
 
jamie398
just joined
Topic Author
Posts: 13
Joined: Sat Mar 25, 2017 10:39 pm

DHCP Question Please

Tue Jul 05, 2022 11:37 pm

Hi, I went to a new site today to do some bit's. While I was there I went to the login page on winbox for an existing router onsite whilst I was waiting for the customer to see if he could get the password. However I logged in without ANY password and grabbed the config to have a look at later. The WAN was on a dhcp client from a BT hub. We connected some kit on the LAN side and let the router hand out via dhcp. We were given a 192.168.0.0/24 address and had internet etc. Looking at the DHCP pool however it looks like the default 88.x. How were we handed this address?
# jul/05/2022 11:53:40 by RouterOS 6.45.3
# software id = 601S-KQCH
#
# model = RB2011iL
# serial number = xxxxxx
/interface bridge
add admin-mac=xxxxxx auto-mac=no comment=defconf name=bridge
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=default-dhcp ranges=192.168.88.10-192.168.88.254
/ip dhcp-server
add address-pool=default-dhcp interface=bridge name=defconf
/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=ether6
add bridge=bridge comment=defconf interface=ether7
add bridge=bridge comment=defconf interface=ether8
add bridge=bridge comment=defconf interface=ether9
add bridge=bridge comment=defconf interface=ether10
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
/ip address
add address=192.168.0.1/24 comment=defconf interface=ether2 network=\
    192.168.0.0
/ip dhcp-client
add comment=defconf dhcp-options=hostname,clientid disabled=no interface=\
    ether1
/ip dhcp-server network
add address=192.168.0.0/24 comment=defconf gateway=192.168.0.1 netmask=24
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.0.1 comment=defconf name=router.lan
/ip firewall filter
add action=accept chain=input comment=\
    "defconf: accept established,related,untracked" connection-state=\
    established,related,untracked
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=accept chain=input comment=\
    "defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
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
/system clock
set time-zone-name=Europe/London
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
 
User avatar
k6ccc
Forum Guru
Forum Guru
Posts: 1490
Joined: Fri May 13, 2016 12:01 am
Location: Glendora, CA, USA (near Los Angeles)
Contact:

Re: DHCP Question Please

Wed Jul 06, 2022 7:52 am

Well for starters, your DHCP server network is 192.168.0.0/24 and the DHCP server is not specifying which IP Pool to use.
 
jamie398
just joined
Topic Author
Posts: 13
Joined: Sat Mar 25, 2017 10:39 pm

Re: DHCP Question Please

Wed Jul 06, 2022 9:39 am

Well for starters, your DHCP server network is 192.168.0.0/24 and the DHCP server is not specifying which IP Pool to use.
Where is that please?
/ip pool
add name=default-dhcp ranges=192.168.88.10-192.168.88.254
/ip dhcp-server
add address-pool=default-dhcp interface=bridge name=defconf
I can see the DHCP network defined
/ip dhcp-server network
add address=192.168.0.0/24 comment=defconf gateway=192.168.0.1 netmask=24
But how will it know what addresses to use or will it just do the whole /24?
 
User avatar
k6ccc
Forum Guru
Forum Guru
Posts: 1490
Joined: Fri May 13, 2016 12:01 am
Location: Glendora, CA, USA (near Los Angeles)
Contact:

Re: DHCP Question Please

Wed Jul 06, 2022 4:42 pm

That's what I get for trying to read a config when I am dead tired.
I missed that the pool was specified, but the IP for the router is specified as 192.168.0.1/24 as is the gateway. Essentially everywhere in the config where an IP address is specified it is in the 192.168.0.0/24 net except the IP pool for the DHCP server.
Also, the router IP address is specified as ether2 and as I understand it, that should be on the bridge (I'm not good with bridges).
 
jamie398
just joined
Topic Author
Posts: 13
Joined: Sat Mar 25, 2017 10:39 pm

Re: DHCP Question Please

Wed Jul 06, 2022 11:18 pm

Essentially everywhere in the config where an IP address is specified it is in the 192.168.0.0/24 net except the IP pool for the DHCP server.
That's the bit I found confusing, looks like the wrong address for the pool but I was correctly handed a 192.168.0.0/24 address but not sure how.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19099
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: DHCP Question Please  [SOLVED]

Thu Jul 07, 2022 12:02 am

/ip address
add address=192.168.0.1/24 comment=defconf interface=ether2 network=\
192.168.0.0

To this
/ip address
add address=192.168.0.1/24 comment=defconf interface=bridge network=\
192.168.0.0

Who is online

Users browsing this forum: petertosh and 25 guests