Solved Anyone using Mikrotik router?

fred974

Daemon

Reaction score: 45
Messages: 1,628

Does anyone here used Mikrotik router before?
We just received a new router but I have no idea on how to set a static IP address to interface ether5.

I have a webserver and we have a static IP defice in the /etc/rc.conf of the server but the Mikrotik router is not giving out the IP we requested like with Netgear

I know this is really weird question but .. never know :)
 

usdmatt

Daemon

Reaction score: 602
Messages: 1,543

I've used a lot of Mikrotik gear. Your question is a bit confusing though. Have you configured a static IP address on the FreeBSD box, or are you trying to assign it with DHCP from the Mikrotik?
 
OP
fred974

fred974

Daemon

Reaction score: 45
Messages: 1,628

Hi usdmatt

Thank you very much for reply to me..
Yes, I have set a static IP address in my FreeBSD server as follow:
/etc/rc.conf
Code:
ifconfig_bge0="inet 192.168.88.175 netmask 255.255.255.0"
defaultrouter="192.168.88.1"
The server is connected to ethernet port5. When I reboot the FreeBSD server, I have no ip address allocated.
If I set
Code:
ifconfig_bge0="dhcp"
then I can see an IP address..

I have never used Mikrotik in the past and usually, I don't need to do anything further to get my IP..

I tried to give interface 5 a static IP with
Code:
[admin@MikroTik] > ip address add address=192.168.88.175/24 interface=ether5
but got
Code:
invalid value for argument address
As I know nothing (yet) about the Mikrotik router, I have used quickset WISP AP to get me going with things

Hope you can help me

Thank you
 

usdmatt

Daemon

Reaction score: 602
Messages: 1,543

The server is connected to ethernet port5. When I reboot the FreeBSD server, I have no ip address allocated.

The router has absolutely no effect on configuring network settings on the FreeBSD box. If you've set a static IP in /etc/rc.conf and it's not assigned on boot, you've got something wrong in FreeBSD somewhere.

Also you're setting the same IP on both the FreeBSD box and router in your last post?

Can you show the output of the following two commands so I can see the interface layout and current IP settings. (If you have a wan IP you can hide that if you want)
Also what model of Mikrotik is it?
Code:
interface export
ip address export
 
OP
fred974

fred974

Daemon

Reaction score: 45
Messages: 1,628

Hi usdmatt,

I have made a few changes since yesterday trying to get things working...
So here is the full picture..
I ran the following command to set interface=ether7 to be IP 192.168.88.245
Code:
[admin@MikroTik] > /ip address add address=192.168.88.245/24 interface=ether7
Code:
[admin@MikroTik] > /ip address print
Flags: X - disabled, I - invalid, D - dynamic
#   ADDRESS            NETWORK         INTERFACE                                                                                                                                                                                                        
0   ;;; defconf
     192.168.88.1/24    192.168.88.0    ether2-master                                                                                                                                                                                                    
1   192.168.88.245/24  192.168.88.0    ether7                                                                                                                                                                                                            
2 D 86.19.244.xxx/21    86.19.240.0     ether1
On my FreeBSD server, I set the my /etc/rc.conf file with the following and plug the server to ethernet 7:
Code:
ifconfig_bge0="inet 192.168.88.245 netmask 255.255.255.0"
defaultrouter="192.168.88.1"
/etc/resolv.conf
Code:
nameserver 8.8.8.8
On the server ifconfig does show the static ip address but I am unable to ping anything. On the Mikrotik side, I get no lease on interface ether7
Code:
[admin@MikroTik] > /ip dhcp-server lease print                                
Flags: X - disabled, R - radius, D - dynamic, B - blocked
#   ADDRESS                                                                MAC-ADDRESS       HOST-NAME                              SERVER                              RATE-LIMIT                              STATUS
0 D 192.168.88.250                                                         1C:98:EC:0F:49:7E ILOCZ1xxxxxCK\00                       defconf                                                                     bound
1 D 192.168.88.254                                                         28:C6:8E:35:5D:2B SRV-TRI-xxxxx                          defconf                                                                     bound
2 D 192.168.88.246                                                         34:A3:95:27:E5:10 Freds-iPad                             defconf                                                                     bound
3 D 192.168.88.241                                                         00:EE:BD:9C:B4:A3 android-5b8c6a1352a12b06               defconf                                                                     bound
4 D 192.168.88.248                                                         9C:B7:0D:F5:7E:6B MyLaptop                               defconf                                                                     bound
5 D 192.168.88.253                                                         F0:76:1C:27:D0:63 MDesktop                               defconf                                                                     bound
interface export
Code:
[admin@MikroTik] > interface export          
# jul/18/2016 10:48:20 by RouterOS 6.35.4
# software id = JXJD-4PJL
#
/interface bridge
add admin-mac=4C:5E:0C:xx:9A:xx auto-mac=no comment=defconf name=bridge
/interface ethernet
set [ find default-name=ether2 ] name=ether2-master
set [ find default-name=ether3 ] master-port=ether2-master
set [ find default-name=ether4 ] master-port=ether2-master
set [ find default-name=ether5 ] master-port=ether2-master
set [ find default-name=ether6 ] name=ether6-master
set [ find default-name=ether7 ] master-port=ether6-master
set [ find default-name=ether8 ] master-port=ether6-master
set [ find default-name=ether9 ] master-port=ether6-master
set [ find default-name=ether10 ] master-port=ether6-master
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=20/40mhz-Ce disabled=no distance=indoors frequency=auto mode=ap-bridge ssid=MikroTik-C79A9B wireless-protocol=802.11
/interface wireless security-profiles
set [ find default=yes ] authentication-types=wpa2-psk mode=dynamic-keys wpa-pre-shared-key=secretpassword wpa2-pre-shared-key=secretpassword
/interface bridge port
add bridge=bridge comment=defconf interface=ether2-master
add bridge=bridge comment=defconf interface=ether6-master
add bridge=bridge comment=defconf interface=sfp1
add bridge=bridge comment=defconf interface=wlan1
ip address export
Code:
[admin@MikroTik] > ip address export
# jul/18/2016 10:50:17 by RouterOS 6.35.4
# software id = JXJD-4PJL
#
/ip address
add address=192.168.88.1/24 comment=defconf interface=ether2-master network=192.168.88.0
add address=192.168.88.245/24 interface=ether7 network=192.168.88.0
Thank you for your help :)
 

usdmatt

Daemon

Reaction score: 602
Messages: 1,543

I ran the following command to set interface=ether7 to be IP 192.168.88.245

The router already has an IP address of 192.168.88.1. Is there any reason you're trying to assign it a second IP address on eth7, or are you just getting confused?
(As I've already mentioned you seem to be giving the FreeBSD machine the same address)

On the server ifconfigdoes show the static ip address but I am unable to ping anything. On the Mikrotik side, I get no lease on interface ether7

If the FreeBSD machine has a static of 192.168.88.245 set, why would you expect it to get a DHCP lease from the router?

At the moment your router is configured as follows -
ether2 is a master port with 3,4 & 5 as slaves. This means that the router only really "sees" ether2. Traffic between these ports is switched in hardware.
The same goes for ether6 which is a master and has 7, 8, 9 & 10 as slaves.
ether2, ether6, the SFP port and the wireless interface are then all bridged together, effectively connecting everything apart from ether1 together.
ether1 will be your WAN interface, which by default on RouterOS is configured to try and get DHCP.

I suspect this is a RB2011 with wifi (really nice little router) or something similar. The reason these devices are configured this way is because ports 1-5 are on one switch chip, and the other 5 ports have a separate switch chip. ether1 is set as an independent port to use as the WAN. 2/3/4/5 are set as a hardware switched group. The 5 ports on the other switch chip are also set as a hardware switched group, and then the two groups are bridged so that ports 2-10 can all talk to each other and become your LAN ports.

If you want to assign another address to the LAN side of the router, you should either assign it to the ether2 interface, as they have done in their default config, or directly on the bridge interface, as is normally advised in FreeBSD.

My main problem is that I don't really see what you're trying to do. The router already has 192.168.88.1 assigned. If you give the FreeBSD box 192.168.88.245 and a gateway of 192.168.88.1, you should be able to ping the router by connecting the FreeBSD box to any port other than ether1. If you're trying to set something up more complicated (such as making ether7 an independent port with its own address) then you'll have to start by explaining the network design you're trying to achieve.
 

sizigee

Member

Reaction score: 4
Messages: 56

My main problem is that I don't really see what you're trying to do. The router already has 192.168.88.1 assigned. If you give the FreeBSD box 192.168.88.245 and a gateway of 192.168.88.1, you should be able to ping the router by connecting the FreeBSD box to any port other than ether1. If you're trying to set something up more complicated (such as making ether7 an independent port with its own address) then you'll have to start by explaining the network design you're trying to achieve.

I agree with usdmatt, I cannot see what you are trying to do. If your FreeBSD server has a static IP address assigned and the gateway setup, then that should work. No need to setup anything on your router... unless you want to do port-forwarding (if it is a web/application server).
 
OP
fred974

fred974

Daemon

Reaction score: 45
Messages: 1,628

The router already has an IP address of 192.168.88.1. Is there any reason you're trying to assign it a second IP address on eth7, or are you just getting confused?
I was getting confused...
I read your last post several time to get my head around it and the penny finally drop :)
I removed the address that I set in eth7 and I now have full network access.
If the FreeBSD machine has a static of 192.168.88.245 set, why would you expect it to get a DHCP lease from the router?
ummm... Need more cofee sorry.

This lead up to my final question if I can..
where can I list/view all the static IP address attched to the Mikrotik router?
 

usdmatt

Daemon

Reaction score: 602
Messages: 1,543

A router doesn't really have a way of knowing what's connected to it. I could plug a PC in on 192.168.88.10 and the router wouldn't know I was there unless it did a network scan or I sent it some packets of data.

There are two things you can look at though

/ip dhcp lease print
As in your post above, shows any devices that have been connected to the router and requested an IP address using DHCP. Computers that have a static IP set such as your FreeBSD machine obviously won't show here.

/ip arp print
Shows the arp table, which should include pretty much everything the router has sent packets to.
 
Top