Yes... kind of like that.
Previously, I successfully accessed the Samba server on the Linux box using VLC media player on Android by its IP address (192.168.100.2).
The router B's firewall settings are as follows:
config defaults
option input 'DROP'
option output 'ACCEPT'
option forward 'DROP'
option synflood_protect '1'
option drop_invalid '1'
config zone
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
option family 'ipv4'
list network 'lan'
config zone
option name 'wan'
option input 'DROP'
option output 'ACCEPT'
option forward 'DROP'
option masq '1'
option mtu_fix '1'
option family 'ipv4'
list network 'wan'
config forwarding
option src 'lan'
option dest 'wan'
config rule
option name 'Allow-DHCP-Renew'
option src 'wan'
option proto 'udp'
option dest_port '68'
option target 'ACCEPT'
option family 'ipv4'
config rule
option name 'Allow-Ping'
option src 'wan'
option proto 'icmp'
option icmp_type 'echo-request'
option family 'ipv4'
option target 'ACCEPT'
config rule
option name 'Allow-IGMP'
option src 'wan'
option proto 'igmp'
option family 'ipv4'
option target 'ACCEPT'
config rule
option name 'Allow-IPSec-ESP'
option src 'wan'
option dest 'lan'
option proto 'esp'
option family 'ipv4'
option target 'ACCEPT'
config rule
option name 'Allow-ISAKMP'
option src 'wan'
option dest 'lan'
option dest_port '500'
option proto 'udp'
option family 'ipv4'
option target 'ACCEPT'
config redirect
option dest 'wan'
option target 'DNAT'
option name 'test'
option family 'ipv4'
option src 'lan'
option src_dport '139'
option dest_ip '192.168.100.2'
option dest_port '139'
config redirect
option dest 'wan'
option target 'DNAT'
option name 'test2'
option family 'ipv4'
option src 'lan'
option src_dport '445'
option dest_ip '192.168.100.2'
option dest_port '445'
Now, I need to automatically detect the Samba domain when using VLC media player on Android.
The Linux box also has an Unbound DNS server configured, and the router B's DNS listens to the Linux box.
The router B's dhcp settings are as follow:
config dnsmasq
option rebind_protection '0'
option domain 'arpa'
option expandhosts '1'
option cachesize '0'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option localservice '0'
option ednspacket_max '1232'
option sequential_ip '1'
option boguspriv '0'
option nonegcache '1'
option port '53'
list interface 'lan'
option dhcpleasemax '10'
option max_cache_ttl '0'
option dnsforwardmax '1500'
option min_cache_ttl '0'
option domainneeded '1'
option authoritative '1'
option noresolv '1'
option strictorder '1'
list server '192.168.100.2'
config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
The router B's network settings are as follow:
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
config device
option name 'br-lan'
option type 'bridge'
option ipv6 '0'
list ports 'eth0.2'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option delegate '0'
list ipaddr '192.168.254.1/24'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '1'
option ports '3 6t'
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '4 6t'
config device
option name 'eth0.2'
option type '8021q'
option ifname 'eth0'
option vid '2'
option ipv6 '0'
config device
option name 'eth0'
option ipv6 '0'
config device
option name 'eth0.1'
option type '8021q'
option ifname 'eth0'
option vid '1'
option ipv6 '0'
config device
option name 'phy1-ap0'
option ipv6 '0'
config interface 'wan'
option proto 'dhcp'
option device 'eth0.1'
option hostname '*'
And I want to tell that the router A's do not allow me to change DNS DHCP. The ISP locks the section to change DNS manually on its router.
By the way, the router A model name is HG8145V5 (GPON Modem+Router).
Update:
Actually, I can still use 1 LAN port available on router B and connect the Linux Box directly to that port to make setting up the Samba Server easier.
However, because router B is relatively low-end, I connected the Linux Box to router A using the 1st port on router A for the reason that router B can work faster.
Router model B is BL201. BL201 and BL100 have the same hardware. The difference is, the BL201 does not have a 4G modem and the BL100 does. So I used the BL100 firmware on a BL201 device. I hope that doesn't cause any problems.