Static router don't work.

Hello,

Im have problem with route between two interfaces.
Im have:
bridge1 (all interfaces)
ether1 (LAN1, 192.168.0.0/16)
ethet7 (WAN)
ether8 (LAN2, 192.170.1.0/24)

When im connect to LAN1 im can't ping device in LAN2 (im can ping only ether8 - 192.170.1.1).
Im create static router (dest: 192.168.1.0/24, gateway: ether8) but still don't work. Someone can help?

DST-ADDRESS PREF-SRC GATEWAY DISTANCE

0 A S 0.0.0.0/0 78.11.xxx.xxx 2
1 ADC 78.11.xxx.xxx/30 78.11.xxx.xxx ether7 0
2 ADC 192.168.0.0/16 192.168.1.1 bridge1 0
3 ADC 192.170.1.0/24 192.170.1.1 bridge1 0
4 S 192.170.1.0/24 ether8 1

  1. If you have two independent LANs, you probably don’t want them to be part of same bridge.
  2. Routes for connected subnets are added automatically, you don’t need to add another route to 192.170.1.0/24, when you already have it. If you don’t like that it appears on bridge1, see 1).
  3. 192.170.1.0/24 is public subnet, so unless you actually got it from ISP (most likely not), you should not use it.
  4. Router will by default try to route everything, but it also depends on other devices, what they send to router. Is this router default gateway for all connected devices in both LANs?
  1. On one port im have WAN. In don’t need bride to access to WAN? (In need wan on all port)
  2. Ok, deleted
  3. In need second subnet, so better use 192.160.1.0/24?
  4. Yes, one device have gateway 192.168.1.1 (LAN1) and second one 192.170.1.1 (LAN2).

In bridge for LAN2 is record “PREF-SRC” setting at “192.170.1.0”. So im think he route LAN2 only packed from 192.170.1.0, but im don’t know how change it.

When im connect to LAN1 but im change my IP to LAN2 network im can ping LAN2 device.

  1. Bridge is software equivalent of hardware switch, it connects ports together. If you have two different LANs, it’s usually because you want to isolate them in some way, you wouldn’t connect all devices from both LANs to same switch, and it’s the same with bridge. But if you do it, it should still work, you just won’t be able to control communication between two LANs very well (that’s why you can set LAN2 address in LAN1 port and it works).
  2. 192.160.1.0/24 is still public subnet. Available private subnets are 192.168.0.0/16, 10.0.0.0/8 and 172.16.0.0/12. And one important thing, you can divide them in smaller ones, so you can have e.g. 192.168.0.0/24, 192.168.1.0/24, 192.168.2.0/24, …
  3. So this router has both addresses 192.168.1.1/16 and 192.170.1.1/24, and other devices have these addresses as their default gateways? If so, it should work. Maybe it’s blocked by firewall?

It would be probably best to export your configuration (command “/export hide-sensitive” in terminal) and post it here.

  1. Thx, im need second LAN for VPN -> my hardware VPN request two interfaces.
  2. Thx, I'll change it.
  3. Exactly, but don't work :<

Below my config:

telnet
/export hide-sensitive

jul/13/2016 22:30:23 by RouterOS 6.18

software id = T0XE-I0GK

/interface bridge
add l2mtu=1590 name=bridge1
add name=bridge2
/ip pool
add name=dhcp ranges=192.168.50.1-192.168.55.255
add name=dhcp-VPN ranges=192.170.1.10-192.170.1.99
/ip dhcp-server
add address-pool=dhcp disabled=no interface=bridge1 lease-time=1d name=dhcp1
add address-pool=dhcp-VPN interface=ether8 name=VPN-DHCP
/interface bridge port
add bridge=bridge1 interface=ether1
add bridge=bridge1 interface=ether2
add bridge=bridge1 interface=ether3
add bridge=bridge1 interface=ether4
add bridge=bridge1 interface=ether5
add bridge=bridge1 interface=ether6
add bridge=bridge1 disabled=yes interface=ether7
add bridge=bridge1 interface=ether8
add bridge=bridge1 interface=sfp-sfpplus1 path-cost=5
add bridge=bridge1 interface=sfp-sfpplus2 path-cost=5
/ip address
add address=192.168.1.1/16 comment="default configuration" disabled=yes
interface=bridge1 network=192.168.0.0
add address=78.11.xxx.xxx/30 interface=ether7 network=78.11.xxx.xxx
add address=192.168.1.1/16 interface=ether1 network=192.168.0.0
add address=192.170.1.1/24 interface=ether8 network=192.170.1.0
/ip dhcp-client
add dhcp-options=hostname,clientid interface=sfp-sfpplus2
/ip dhcp-server config
set store-leases-disk=23h59m59s
/ip dhcp-server lease
add address=192.168.30.5 client-id=1:68:f7:28:69:a7:3d comment=
"xxx" mac-address=68:F7:28:69:A7:3D server=dhcp1
add address=192.168.30.1 always-broadcast=yes client-id=1:d4:be:d9:58:be:38
comment="xxx" mac-address=D4:BE:D9:58:BE:38 server=dhcp1
/ip dhcp-server network
add address=192.168.0.0/16 gateway=192.168.1.1 netmask=16
add address=192.170.1.0/24 gateway=192.170.1.1
/ip dns
set servers=192.168.3.1,87.204.204.204,8.8.8.8
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether7 src-address=
192.168.0.0/16
add action=dst-nat chain=dstnat dst-port=500 in-interface=all-ethernet
protocol=udp to-addresses=192.168.50.18 to-ports=500
add action=dst-nat chain=dstnat dst-port=4500 in-interface=all-ethernet
protocol=udp to-addresses=192.168.50.18 to-ports=4500
add action=dst-nat chain=dstnat protocol=ipsec-ah to-addresses=192.168.50.18
add action=dst-nat chain=dstnat protocol=ipsec-esp to-addresses=192.168.50.18
add chain=dstnat dst-address=192.170.1.0
/ip ipsec policy
set (unknown) disabled=yes
/ip route
add distance=2 gateway=78.11.xxx.xxx
add distance=1 dst-address=192.170.1.0/24 gateway=ether8
/ip service
set www port=88
/ip upnp
set allow-disable-external-interface=no
/lcd
set time-interval=daily
/system clock
set time-zone-name=Europe/xxx
/system identity
set name=xxx
/system leds
set 0 type=interface-speed
set 2 type=interface-speed
/system routerboard settings
set cpu-frequency=1200MHz memory-frequency=1066DDR

There are some mistakes in your config, but nothing that would prevent it from working. Do you test only ping? Are you sure it’s not just blocked by target device? You don’t have any firewall filter rules, so if packet comes to router, it will forward it.

Anyway, you should remove ether8 from bridge, that’s clearly wrong. Then you don’t need this rule:

/ip route
add distance=1 dst-address=192.170.1.0/24 gateway=ether8

Then use Tools->Torch and see what happens. If you ping 192.168.x.x from 192.170.1.y, you must first see incoming packet on ether8 and then the same packet as outgoing on bridge1. And the other way around. If this is ok, but you don’t see any reply packets coming back, blame target device.

Thx, im for test change router (use basic ASUS).

With new router have this same problem, but when im make static router on ASUS everythis work correct.

So problem is with mikrotik config, not other device.

Now on ip router im have

/ip route
add distance=2 gateway=78.11.xxx.xxx

This does not mean all route goint to wan (78.11.xxx.xxx)? Maybe this is problem?
ASUS static route.png