I need some setting up router connected to Tmobile Gateway

I have a t mobile gateway sagemon 5380. I have one hidden ssid so that i can access the gateway without having to physically connect to it. The gateway plugs into a TP-Link Archer A7 v5 which I want to control the wifi, etc. I have two ssids on the Tp link, one for 2.4g and one for 5g. In addition, due to some older components like an older non wifi sec camera dvr i have an unmanaged switch coming that has an ethernet cable from the TP link to the switch that goes to the dvr. Any help appreciated. Im not sure if the settings i did are correct or not. Any way to generate a config file, etc. to have someone take a look at? Thanks!

Here is the config files. etc.



config wifi-device 'radio0'
	option type 'mac80211'
	option path 'pci0000:00/0000:00:00.0'
	option channel 'auto'
	option band '5g'
	option htmode 'VHT80'
	option cell_density '0'
	option country 'US'
	option txpower '24'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option ssid '5g'
	option encryption 'psk2+tkip+ccmp'
	option key 'xxxxx'
	option macfilter 'deny'
	list maclist 'xxxxx'

config wifi-device 'radio1'
	option type 'mac80211'
	option path 'platform/ahb/18100000.wmac'
	option channel 'auto'
	option band '2g'
	option cell_density '0'
	option country 'US'
	option htmode 'HT40'
	option txpower '24'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option ssid '2g'
	option encryption 'psk2+tkip+ccmp'
	option key 'xxxxxx'
	option macfilter 'deny'
	list maclist 'xxxxx'


config uhttpd 'main'
	list listen_http '0.0.0.0:80'
	list listen_http '[::]:80'
	list listen_https '0.0.0.0:443'
	list listen_https '[::]:443'
	option redirect_https '0'
	option home '/www'
	option rfc1918_filter '1'
	option max_requests '3'
	option max_connections '100'
	option cert '/etc/uhttpd.crt'
	option key '/etc/uhttpd.key'
	option cgi_prefix '/cgi-bin'
	list lua_prefix '/cgi-bin/luci=/usr/lib/lua/luci/sgi/uhttpd.lua'
	option script_timeout '60'
	option network_timeout '30'
	option http_keepalive '20'
	option tcp_keepalive '1'
	option ubus_prefix '/ubus'

config cert 'defaults'
	option days '730'
	option key_type 'ec'
	option bits '2048'
	option ec_curve 'P-256'
	option country 'ZZ'
	option state 'Somewhere'
	option location 'Unknown'
	option commonname 'OpenWrt'

config network
	option init network
	list affects dhcp

config wireless
	list affects network

config firewall
	option init firewall
	list affects luci-splash
	list affects qos
	list affects miniupnpd

config olsr
	option init olsrd

config dhcp
	option init dnsmasq
	list affects odhcpd

config odhcpd
	option init odhcpd

config dropbear
	option init dropbear

config httpd
	option init httpd

config fstab
	option exec '/sbin/block mount'

config qos
	option init qos

config system
	option init led
	option exec '/etc/init.d/log reload'
	list affects luci_statistics
	list affects dhcp

config luci_splash
	option init luci_splash

config upnpd
	option init miniupnpd

config ntpclient
	option init ntpclient

config samba
	option init samba

config tinyproxy
	option init tinyproxy


config system
	option hostname 'xxxxx'
	option timezone 'UTC'
	option ttylogin '0'
	option log_size '64'
	option urandom_seed '0'

config timeserver 'ntp'
	option enabled '1'
	option enable_server '0'
	list server '0.openwrt.pool.ntp.org'
	list server '1.openwrt.pool.ntp.org'
	list server '2.openwrt.pool.ntp.org'
	list server '3.openwrt.pool.ntp.org'

config led 'led_wan'
	option name 'WAN'
	option sysfs 'green:wan'
	option trigger 'switch0'
	option port_mask '0x02'

config led 'led_lan1'
	option name 'LAN1'
	option sysfs 'green:lan1'
	option trigger 'switch0'
	option port_mask '0x04'

config led 'led_lan2'
	option name 'LAN2'
	option sysfs 'green:lan2'
	option trigger 'switch0'
	option port_mask '0x08'

config led 'led_lan3'
	option name 'LAN3'
	option sysfs 'green:lan3'
	option trigger 'switch0'
	option port_mask '0x10'

config led 'led_lan4'
	option name 'LAN4'
	option sysfs 'green:lan4'
	option trigger 'switch0'
	option port_mask '0x20'


config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'xxxxxxx'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0.1'

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option ipaddr '192.168.12.2'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option gateway '192.168.12.1'
	list dns '192.168.12.1'
	option broadcast '192.168.12.255'

config device
	option name 'eth0.2'
	option macaddr 'xxxxxx'

config interface 'wan'
	option device 'eth0.2'
	option proto 'dhcp'

config interface 'wan6'
	option device 'eth0.2'
	option proto 'dhcpv6'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '2 3 4 5 0t'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '1 0t'

config defaults
	option syn_flood	1
	option input		REJECT
	option output		ACCEPT
	option forward		REJECT
# Uncomment this line to disable ipv6 rules
#	option disable_ipv6	1

config zone
	option name		lan
	list   network		'lan'
	option input		ACCEPT
	option output		ACCEPT
	option forward		ACCEPT

config zone
	option name		wan
	list   network		'wan'
	list   network		'wan6'
	option input		REJECT
	option output		ACCEPT
	option forward		REJECT
	option masq		1
	option mtu_fix		1

config forwarding
	option src		lan
	option dest		wan

# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
	option name		Allow-DHCP-Renew
	option src		wan
	option proto		udp
	option dest_port	68
	option target		ACCEPT
	option family		ipv4

# Allow IPv4 ping
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

# Allow DHCPv6 replies
# see https://github.com/openwrt/openwrt/issues/5066
config rule
	option name		Allow-DHCPv6
	option src		wan
	option proto		udp
	option dest_port	546
	option family		ipv6
	option target		ACCEPT

config rule
	option name		Allow-MLD
	option src		wan
	option proto		icmp
	option src_ip		fe80::/10
	list icmp_type		'130/0'
	list icmp_type		'131/0'
	list icmp_type		'132/0'
	list icmp_type		'143/0'
	option family		ipv6
	option target		ACCEPT

# Allow essential incoming IPv6 ICMP traffic
config rule
	option name		Allow-ICMPv6-Input
	option src		wan
	option proto	icmp
	list icmp_type		echo-request
	list icmp_type		echo-reply
	list icmp_type		destination-unreachable
	list icmp_type		packet-too-big
	list icmp_type		time-exceeded
	list icmp_type		bad-header
	list icmp_type		unknown-header-type
	list icmp_type		router-solicitation
	list icmp_type		neighbour-solicitation
	list icmp_type		router-advertisement
	list icmp_type		neighbour-advertisement
	option limit		1000/sec
	option family		ipv6
	option target		ACCEPT

# Allow essential forwarded IPv6 ICMP traffic
config rule
	option name		Allow-ICMPv6-Forward
	option src		wan
	option dest		*
	option proto		icmp
	list icmp_type		echo-request
	list icmp_type		echo-reply
	list icmp_type		destination-unreachable
	list icmp_type		packet-too-big
	list icmp_type		time-exceeded
	list icmp_type		bad-header
	list icmp_type		unknown-header-type
	option limit		1000/sec
	option family		ipv6
	option target		ACCEPT

config rule
	option name		Allow-IPSec-ESP
	option src		wan
	option dest		lan
	option proto		esp
	option target		ACCEPT

config rule
	option name		Allow-ISAKMP
	option src		wan
	option dest		lan
	option dest_port	500
	option proto		udp
	option target		ACCEPT


### EXAMPLE CONFIG SECTIONS
# do not allow a specific ip to access wan
#config rule
#	option src		lan
#	option src_ip	192.168.45.2
#	option dest		wan
#	option proto	tcp
#	option target	REJECT

# block a specific mac on wan
#config rule
#	option dest		wan
#	option src_mac	xxxxxxxxx
#	option target	REJECT

# block incoming ICMP traffic on a zone
#config rule
#	option src		lan
#	option proto	ICMP
#	option target	DROP

# port redirect port coming in on wan to lan
#config redirect
#	option src			wan
#	option src_dport	80
#	option dest			lan
#	option dest_ip		192.168.16.235
#	option dest_port	80
#	option proto		tcp

# port redirect of remapped ssh port (22001) on wan
#config redirect
#	option src		wan
#	option src_dport	22001
#	option dest		lan
#	option dest_port	22
#	option proto		tcp

### FULL CONFIG SECTIONS
#config rule
#	option src		lan
#	option src_ip	192.168.45.2
#	option src_mac	xxxxxxxx
#	option src_port	80
#	option dest		wan
#	option dest_ip	194.25.2.129
#	option dest_port	120
#	option proto	tcp
#	option target	REJECT

#config redirect
#	option src		lan
#	option src_ip	192.168.45.2
#	option src_mac	xxxxxxxxx
#	option src_port		1024
#	option src_dport	80
#	option dest_ip	194.25.2.129
#	option dest_port	120
#	option proto	tcp

config dnsmasq
	option domainneeded '1'
	option boguspriv '1'
	option filterwin2k '0'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option nonegcache '0'
	option cachesize '1000'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
	option nonwildcard '1'
	option localservice '1'
	option ednspacket_max '1232'
	option filter_aaaa '0'
	option filter_a '0'

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option dhcpv4 'server'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'


The configuration is a bridged or "dumb" AP. This leaves all of the firewall and routing being done in the gateway box. Is it DSL? When I think T-Mobile I think LTE which is what I use. Does the ISP support IPv6? You may already be using primarily IPv6 without even knowing it since a bridged AP is agnostic to v4 vs v6.

Look at gateway boxes as being only a link to the Internet and move all the routing and firewall into your OpenWrt router. You may want to consider improvements like a separate network for the cameras and DVR which can't reach the Internet or your other devices, and a VPN which would allow you and only you to reach the cameras and DVR from the Internet when you are away from home.

Its a 5g cell gateway box from tmobile. The camera has an app that allows me to remote view and notified which is what I want, via the internet. I dont know about the IPv6 as the tmobile admin is crap, basically just lets you add ssid's and thats it.. So anyway to improve things or should i change anything? Trying to make this as clean as possible without issues regarding addressing etc. Thx

Staying within a bridged design, you should still make the following changes:

  • Shut down the dhcp server on lan. The T-Mobile box is serving DHCP. Some guides say to disable the whole dnsmasq service, but I don't recommend that as you may want it for something else later. Change the lan section in /etc/config/dhcp to have an 'ignore 1' option and 'dhcpv4 disabled'
  • Set legacy_rates 0 on the 2.4 GHz radio. This can decrease your absolute maximum radio range some but it will improve performance for everyone who is close to the router. Install additional APs if very wide coverage is needed.
  • 40 MHz on 2.4 only works if you have absolutely no neighbors on wifi. Set to HT20 in all other cases.
  • You can move the blue WAN port (switch port 1) into the lan switch-vlan to have another usable Ethernet port in the bridge.