Basic ip addressing use and bridge setup

Hi,
I am trying to setup a simple few port bridge with vlan.

i want to put two ports in a bridge, and the pc’s connected to this ports need to get an ip address and be able to ping each other and 172.16.10.1

What am i doing wrong ?
If i connect a pc now, it doesn’t get an ip address, but only 169.x.x.x


export below.


/interface bridge
add name=BR-10

/ip pool
add name=default-dhcp ranges=172.16.10.5-172.16.10.10
/ip dhcp-server
add address-pool=default-dhcp disabled=no interface=BR-10 name=default
/port
set 0 name=serial0
/ppp profile
set [ find name=default ] name=default
set [ find name=default-encryption ] name=default-encryption
/interface bridge port
add bridge=BR-10 interface=ether2
add bridge=BR-10 interface=ether3
/ip address
add address=172.16.10.1/24 interface=BR-10 network=172.16.10.0
/lcd interface pages
set 1 interfaces=ether13,ether14,ether15,ether16,ether17,ether18,ether19,ether20,ether21
/tool romon port
add disabled=no

Mamoman -

Looks like you are missing a few components:

The below is from RoS 6.33
DNS entries are bogus of course…

/ip pool
add name=default-dhcp ranges=172.16.10.5-172.16.10.10
/ip dhcp-server
add add-arp=yes address-pool=default-dhcp always-broadcast=yes disabled=no
interface=BR-10 lease-time=3d name=default
/ip dhcp-server config
set store-leases-disk=never
/ip dhcp-server network
add address=172.16.10.0/24 dns-server=111.222.333.444,111.222.333.555 gateway=
172.16.10.1

Thom

First thank you for the feedback on my config.

I have changed it, to the following.

/interface bridge
add name=BR-10
/port
set 0 name=serial0
/ppp profile
set [ find name=default ] name=default
set [ find name=default-encryption ] name=default-encryption
/interface bridge port
add bridge=BR-10 interface=ether2
add bridge=BR-10 interface=ether3
/ip address
add address=172.16.10.1/24 interface=BR-10 network=172.16.10.0
/ip dhcp-server network
add address=172.16.10.0/24 dns-server=8.8.8.8,8.8.4.4 gateway=172.16.10.1
/lcd interface pages
set 1 interfaces=ether13,ether14,ether15,ether16,ether17,ether18,ether19,ether20,ether21
/tool romon port
add disabled=no
[admin@MikroTik] >


But when I connect a pc on ether2 it still does not get an ip address.
tried with fixed, and also cannot ping 172.16.10.1 while the link is up.

regards
martin

Martin
I don’t see this complete entry, specifically arp and broadcast:
/ip dhcp-server
add add-arp=yes address-pool=default-dhcp always-broadcast=yes disabled=no
interface=BR-10 lease-time=3d name=default


Thom

Martin -
Even with a static IP in the range of 172.16.10.2 - 172.16.10.254 you should be able to ping 172.16.10.1 from either ether2 or ether3.

What does /IP ARP in the Mikrotik show when you have a PC connected to either ether2 or 3 with a properly configured IP address?

What does your static entry on the PC look like? 172.16.10.27, netmask 255.255.255.0 or /24 depending on whether it is linux or windows… Does it have the correct gateway, 172.16.10.1 and what about DNS, did you put in a static DNS entry as well? (like 8.8.8.8 - google public dns server).

Thom

If you can’t put a static IP on a computer and connect to ether2 or ether3 and ping the Mikrotik, then you either have a firewall configuration that is blocking you, or else your ethernet ports are configured on the hardware switch as slave ports. (I think ROS actually stops you from doing this nowadays, but make sure that ether2 and ether3 have master port set to none.) See if your filter rules refer to interface ether2 or ether3 - if so then they should be changed to refer to BR-10 instead. Also make sure you didn’t configure any bridge firewall rules that might be breaking things.

the add-arp and always-broadcast configurations shouldn’t normally be required, especially the ARP item, since normal ARP behavior on the IP interface (BR-10) should dynamically discover the MAC addresses of the client devices. You’d only need this if your LAN was doing some type of filtering on broadcast traffic that would prevent ARP from doing its job.

This person is a newbie Zerobyte… And while for the most part your statement is correct there are so many devices out there that don’t play by the rules that adding what I told him can only help, it will not hinder any other p/o the config. Espeically since he seems to have a real issue w/his config, any extra info we can get will be helpful in helping Martin out.

Thom

Hi,
Am used to cisco, but mikrotik is a total different story.

I use a macbook air with USB-Ethernet which I use daily to connect to other networks also.
no firewall on it.

I have the following export now

/interface bridge
add name=BR-10
/ip pool
add name=default-dhcp ranges=172.16.10.5-172.16.10.10
/ip dhcp-server
add add-arp=yes address-pool=default-dhcp always-broadcast=yes disabled=no interface=BR-10 lease-time=3d name=default
/port
set 0 name=serial0
/ppp profile
set [ find name=default ] name=default
set [ find name=default-encryption ] name=default-encryption
/interface bridge port
add bridge=BR-10 interface=ether2
add bridge=BR-10 interface=ether3
/ip address
add address=172.16.10.1/24 interface=BR-10 network=172.16.10.0
/ip dhcp-server network
add address=172.16.10.0/24 dns-server=8.8.8.8,8.8.4.4 gateway=172.16.1.1
/lcd interface pages
set 1 interfaces=ether13,ether14,ether15,ether16,ether17,ether18,ether19,ether20,ether21
/tool romon port
add disabled=no
[admin@MikroTik] >


and when i do a /ip arp print

[admin@MikroTik] /ip arp> print
Flags: X - disabled, I - invalid, H - DHCP, D - dynamic, P - published

ADDRESS MAC-ADDRESS INTERFACE

[admin@MikroTik] /ip arp> export

jan/02/1970 00:02:09 by RouterOS 6.29

Also with static ip no arp entry.

Am getting the impression i have a hardware problem, although my unit is half year old
(tried on ether2 and ether3).
regards
martin

Martin -

ip dhcp-server network
add address=172.16.10.0/24 dns-server=8.8.8.8,8.8.4.4 gateway=172.16.1.1

Gateway should be 172.16.10.1…

It could also be a hardware issue. Can you set an IP address on a different port, w/o a bridge and connect the Mac for just a short test - to test the Mikrotik…

Thom

Thnx i have changed the 172.16.1.1 to 172.16.10.1

I did a factory reset, with default config and then with static ip address on port 1 (ether1) or port 2 (ether2) I could ping from mikrotik the macbook.

[admin@MikroTik] > /ip arp print
Flags: X - disabled, I - invalid, H - DHCP, D - dynamic, P - published

ADDRESS MAC-ADDRESS INTERFACE

0 D 192.168.88.4 AC:7F:3E:E6:74:28 ether1-master-local

and see it in the arp table, just it doesnt matter if i put in ether1 or ether2 in both cases it gives ether1-master-local

I have reset again without config and enter the config again with the gateway change, still no dhcp and no static ip that work.

Martin

Sounds like all the ports are a slave of ether1…

Open the interfaces tab and check each ether port. I would suggest that for the moment that you set ‘master port’ to none on all interfaces…

Also - remember, you can’t have the same ip block on two different interfaces (ports) w/o disabling one of the ip blocks…

Do not setup the bridge until we can get the static ip working, then we’ll go to dhcp, then we’ll setup the bridge and move the ip block and dhcp server to the bridge…

Thom

ok. back to basics

/system reset-configuration

login

r (revert) so empty config.

/ip address
add address=172.16.10.1/24 interface=ether2 network=172.16.10.0

Then i have my mac connected to ether2 and set for 172.16.10.2 and i can ping from the mac to 172.16.10.1

martin

Ok Martin - we’re headed in the right direction…

Let’s add a dhcp server to ether2, then set your Mac to get a dhcp address…

If you can get that to work, then delete the dhcp server and /ip pool on the mikrotik.

Add your bridge, you had ether 2 & 3 in it last time, do the same. Move your IP address from ether2 to your new bridge.

Try a static again on the Mac and let’s see what you get.

Thom

I have added the dhcp via

/ip pool
add name=default-dhcp ranges=172.16.10.5-172.16.10.10
/ip dhcp-server
add add-arp=yes address-pool=default-dhcp always-broadcast=yes disabled=no interface=ether2 lease-time=3d name=default
/ip dhcp-server network
add address=172.16.10.0/24 dns-server=8.8.8.8,8.8.4.4 gateway=172.16.10.1

but the mac does not get an ip on ether2 so DHCP doesn’t work

fixed works.
Martin

What did you fix to make it work?

Thom

Thom, what i mean is i have put al the above lines for dhcp server in, but i don’t get an ip address from the dhcp server.
If I set my mac to fixed ip 172.16.10.2 then i can ping the mikrotik.

So what is wrong in the dhcp setup ?

BTW: software 6.29
Martin

Martin - did you manually setup the dhcp server or did you go through the ‘dhcp setup’ button under /dhcp server in winbox?

Which version of winbox are you using (2.xx I hope).

What is the hardware? RB951 or what?

Thom

I tried both ways.
first via the cli and then i did a /system reset-configuration and did the same via webinterface dhcp-setup.

hardware is CRS226-24G-2S+

regards
Martin

Martin -
A CRS226… Well it would have been helpful to know that earlier… I do not have a CRS handy to work this out with you on…
From what I remember though you have to assign the DHCP server to a port and VLAN (on that port) has to have the port you selected as being able to pass the traffic. In VLAN translation rules you need to set sa-learning=yes.

I don’t remember the rest, if there was anymore, that you need to do to get DHCP running on the CRS.

Sorry Martin.

Thom

Thom, Sorry.
I had to re-enter my new topic 3 times before it finally got on the board. in my previous attempts it had the model also in there.

anyone that can still help me getting this to work ?
Martin