How can connect my router to an existing network so it can access the internet so I can install packages?

I have recently rooted a technicolor tg789 vac-6, which has firmware using openwrt installed by default (has a locked down bootloader so I don't think I could flash a more vannila openwrt image onto it).

This is my first time doing anything like this or using openwrt, though I would consider myself decent with Linux (run gentoo on my desktop), however my networking skills aren't great and I don't know much beyond the fairly basic stuff. Port forwarding, setting up a dhcp server, running a basic web server, that kind of thing.

So I'm currently trying to get my router connected to an existing network so I can start installing some packages and doing some deeper customisation. As of right now I have not been successful in doing so. This has to be done fully in CLI as the web gui provided with the router does not allow you to do this, and because I can't do it, I can't install something like LUCI as doing that would require an internet connection.

Here is the current /etc/config/network (anything thats been commented out was in there by default but I chose to remove)

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

config globals 'globals'
	option ula_prefix 'fd1a:6029:9c77::/48'
	option default_ps '0'

config interface 'lan'
	option ifname 'eth0 eth1 eth2 eth3'
	option force_link '1'
	option type 'bridge'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '64'
	option ip6hint '0'
	option ipaddr '10.1.1.1'
	list pppoerelay ''
	option ipv6 '1'

config interface 'VLAN1'
	option type 'bridge'
	option ip6assign '64'
	option force_link '1'
	option auto '0'

config interface 'VLAN2'
	option type 'bridge'
	option ip6assign '64'
	option force_link '1'
	option auto '0'

config interface 'VLAN3'
	option type 'bridge'
	option ip6assign '64'
	option force_link '1'
	option auto '0'

config interface 'Guest1'
	option proto 'static'
	option ip6assign '64'
	option netmask '255.255.255.0'
	option ipaddr '10.1.2.1'
	option ifname 'wl0_1'
	option force_link '0'

config interface 'Guest1_5GHz'
	option proto 'static'
	option ip6assign '64'
	option netmask '255.255.255.0'
	option ipaddr '10.1.3.1'
	option ifname 'wl1_1'
	option force_link '0'

config switch 'bcmsw'
	option reset '1'
	option enable_vlan '0'
	option qosimppauseenable '0'

config interface 'ppp'
	option proto 'pppoe'
	option metric '10'
	option keepalive '4,20'
	option ipv6 '1'
	option username '_'
	option password '_'
	option ifname 'eth4'

config interface 'pppv'
	option proto 'pppoe'
	option metric '10'
	option keepalive '4,20'
	option ipv6 '1'
	option username '_'
	option password '_'
	option ifname 'vlan_hfc'

config interface 'ipoe'
	option proto 'dhcp'
	option metric '1'
	option reqopts '1 3 6 43 51 58 59'
	option release '1'
	option neighreachabletime '1200000'
	option neighgcstaletime '2400'
	option auto '0'

config interface 'wan6'
	option ifname '@wan'
	option proto 'dhcpv6'
	option reqopts '23 25'
	option reqaddress 'none'
	option noslaaconly '1'
	option ipv6 '1'
	option delegateRestriction 'Off'

config interface 'video'
	option proto 'static'
	option ipaddr '192.168.253.1'
	option netmask '255.255.255.0'
	option igmpversion '2'
	option auto '0'

config interface 'video2'
	option proto 'dhcp'
	option release '1'
	option igmpversion '2'
	option auto '0'

config interface 'video6'
	option ifname '@video'
	option proto 'dhcpv6'
	option reqopts '23 25'
	option reqaddress 'none'
	option noslaaconly '1'

config interface 'wwan'
	option enabled '0'
	option proto 'mobiled'
	option session_id '0'
	option profile '1'

config device 'vlan_ppp'
	option type '8021q'
	option ifname 'ptm0'
	option name 'vlan_ppp'
	option auto '0'
	option vid '2'

config device 'vlan_hfc'
	option type '8021q'
	option ifname 'eth4'
	option name 'vlan_hfc'
	option vid '2'

config device 'vlan_video'
	option type '8021q'
	option name 'vlan_video'
	option vid '13'
	option auto '0'

config device 'eth4'
	option name 'eth4'
	option mtu '1500'

config device 'ptm0'
	option name 'ptm0'
	option mtu '1500'

config device 'atm_ppp'
	option name 'atm_ppp'
	option mtu '1500'

config device 'atm_ipoe'
	option name 'atm_ipoe'
	option mtu '1500'

config config 'config'

config interface 'wan'
#	option reqopts '1 3 6 43 51 58 59'
#	option neighreachabletime '1200000'
#	option neighgcstaletime '2400'
#	option metric '1'
#	option release '1'
	option proto 'dhcp'
	option ifname 'wl0'
#	option ipv6 '1'

Here is my /etc/config/wireless (with sensitive info blanked out with _):

config wifi 'global'
	option station_history_persistent '0'
	option station_history_save_delay '24'
	option radio_remote_mgmt '0'

config wifi-device 'radio_2G'
	option type 'broadcom'
	option country 'AU'
	option channel 'auto'
#	option channelwidth 'auto'
#	option standard 'bgn'
#	option state '1'
#	option rateset '1(b) 2(b) 5.5(b) 6(b) 9 11(b) 12(b) 18 24(b) 36 48 54'
#	option ht_security_restriction '1'
#	option sgi '0'
#	option cdd '0'
#	option frame_bursting '0'
#	option interference_mode 'auto'
#	option interference_channel_list '1 2 3 4 5 6 7 8 9 10 11 12 13'
#	option acs_config_file '/etc/wireless_acs.conf'
#	option acs_state 'selecting'
#	option acs_rescan_period '86400'
#	option acs_trace_level '0'
#	option acs_chanim_tracing '0'
#	option acs_traffic_tracing '0'
#	option acs_policy '6'
#	option acs_rescan_delay '180'
#	option acs_rescan_delay_policy 'notraffic'
#	option acs_rescan_delay_max_events '60'
#	option acs_channel_fail_lockout_period '28800'
#	option acs_monitor_action 'policy'
#	option acs_tx_traffic_threshold '2'
#	option acs_rx_traffic_threshold '2'
#	option acs_traffic_sense_period '10'
#	option acs_interference_span '2'
#	option acs_channel_monitor_period '5'
#	option tx_power_adjust '0'
#	option stbc '0'
#	option tx_power_overrule_reg '1'
#	option disabled '0'

# I added this next config
config wifi-iface
        option network 'wwan'
        option ssid 'Optus_B818_8ACC'
        option encryption 'psk2'
        option device 'radio0'
        option mode 'sta'
        option bssid '58:91:CF:15:B9:5E'
        option key '_'

config wifi-iface 'wl0'
	option device 'radio_2G'
	option mode 'ap'
	option state '1'
	option network 'lan'
	option reliable_multicast '0'
	option ssid 'iiNet6F0E13'

config wifi-ap 'ap0'
	option iface 'wl0'
	option state '1'
	option public '1'
	option ap_isolation '0'
	option station_history '1'
	option max_assoc '0'
	option pmksa_cache '1'
	option wps_state '1'
	option wps_w7pbc '1'
	option wsc_state 'configured'
	option wps_ap_setup_locked '0'
	option wps_credentialformat 'passphrase'
	option acl_mode 'unlock'
	option acl_registration_time '60'
	option trace_modules ' '
	option trace_level 'some'
	option supported_security_modes 'none wep wpa2-psk wpa-wpa2-psk wpa2 wpa-wpa2'
	option security_mode 'wpa2-psk'
	option pmf 'disabled'
	option wep_key '_'
	option wpa_psk_key '_'
	option wps_ap_pin '_'

config wifi-radius-server 'ap0_auth0'
	option state '0'
	option port '1812'
	option priority '3'
	option secret '_'

config wifi-radius-server 'ap0_acct0'
	option state '0'
	option port '1813'
	option priority '3'

config wifi-iface 'wl0_1'
	option device 'radio_2G'
	option mode 'ap'
	option state '1'
	option reliable_multicast '0'
	option network 'Guest1'
	option ssid 'iiNet6F0E13-Guest'

config wifi-ap 'ap1'
	option iface 'wl0_1'
	option state '0'
	option public '1'
	option ap_isolation '1'
	option station_history '1'
	option max_assoc '0'
	option pmksa_cache '1'
	option wps_state '0'
	option wps_w7pbc '1'
	option wsc_state 'configured'
	option wps_ap_setup_locked '0'
	option acl_mode 'unlock'
	option acl_registration_time '60'
	option trace_modules ' '
	option trace_level 'some'
	option supported_security_modes 'none wep wpa2-psk wpa-wpa2-psk wpa2 wpa-wpa2'
	option security_mode 'wpa2-psk'
	option pmf 'disabled'
	option wep_key '_'
	option wpa_psk_key '_'
	option wps_ap_pin '_'

config wifi-device 'radio_5G'
	option type 'broadcom'
	option country 'AU'
	option channel 'auto'
	option channelwidth 'auto'
	option standard 'anac'
	option state '1'
	option rateset '6(b) 9 12(b) 18 24(b) 36 48 54'
	option ht_security_restriction '1'
	option sgi '1'
	option ldpc '1'
	option txbf '1'
	option frame_bursting '0'
	option interference_mode 'auto'
	option acs_allowed_channels '36 40 44 48 149 153 157 161'
	option acs_config_file '/etc/wireless_acs_5g.conf'
	option acs_state 'selecting'
	option acs_rescan_period '86400'
	option acs_trace_level '0'
	option acs_chanim_tracing '0'
	option acs_traffic_tracing '0'
	option acs_policy '6'
	option acs_rescan_delay '180'
	option acs_rescan_delay_policy 'notraffic'
	option acs_rescan_delay_max_events '60'
	option acs_channel_fail_lockout_period '28800'
	option acs_monitor_action 'policy'
	option acs_tx_traffic_threshold '2'
	option acs_rx_traffic_threshold '2'
	option acs_traffic_sense_period '10'
	option acs_interference_span '2'
	option acs_channel_monitor_period '5'
	option tx_power_adjust '0'
	option stbc '0'
	option tx_power_overrule_reg '1'
	option cdd '0'
	option disabled '0'

config wifi-iface 'wl1'
	option device 'radio_5G'
	option mode 'ap'
	option state '1'
	option network 'lan'
	option reliable_multicast '0'
	option ssid 'iiNet6F0E13-5G'

config wifi-ap 'ap2'
	option iface 'wl1'
	option state '1'
	option public '1'
	option ap_isolation '0'
	option station_history '1'
	option max_assoc '0'
	option security_mode 'wpa2-psk'
	option pmf 'disabled'
	option pmksa_cache '1'
	option wps_state '1'
	option wps_w7pbc '1'
	option wsc_state 'configured'
	option wps_credentialformat 'passphrase'
	option wps_ap_setup_locked '0'
	option acl_mode 'unlock'
	option acl_registration_time '60'
	option trace_modules ' '
	option trace_level 'some'
	option wep_key '_'
	option wpa_psk_key '_'
	option wps_ap_pin '_'

config wifi-radius-server 'ap2_auth0'
	option state '0'
	option port '1812'
	option priority '3'
	option secret '_'

config wifi-radius-server 'ap2_acct0'
	option state '0'
	option port '1813'

config wifi-iface 'wl1_1'
	option device 'radio_5G'
	option mode 'ap'
	option state '1'
	option reliable_multicast '0'
	option network 'Guest1_5GHz'
	option ssid 'iiNet6F0E13-5G-Guest'

config wifi-ap 'ap3'
	option iface 'wl1_1'
	option state '0'
	option public '1'
	option ap_isolation '1'
	option station_history '1'
	option max_assoc '0'
	option pmksa_cache '1'
	option wps_state '0'
	option wps_w7pbc '0'
	option wsc_state 'configured'
	option wps_ap_setup_locked '1'
	option acl_mode 'unlock'
	option acl_registration_time '60'
	option trace_modules ' '
	option trace_level 'some'
	option security_mode 'wpa2-psk'
	option pmf 'disabled'
	option wep_key '_'
	option wpa_psk_key '_'
	option wps_ap_pin '_'

And here is the the relevent part (the network I want to connect to) of "wl scanresults":

SSID: "Optus_B818_8ACC"
Mode: Managed	RSSI: -89 dBm	SNR: 0 dB	noise: -23 dBm	Flags: FromBcn RSSI on-channel 	Channel: 36
BSSID: E0:40:07:5E:8A:D1	Capability: ESS WEP ShortPre ShortSlot 
Supported Rates: [ 6(b) 9 12(b) 18 24(b) 36 48 54 ]
VHT Capable:
	Chanspec: 5GHz channel 42 80MHz (0xe02a)
	Primary channel: 36
	HT Capabilities: 40Mhz SGI20 SGI40 
	Supported MCS : [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 96 ]
	VHT Capabilities: 
	Supported VHT (tx) Rates:
		NSS: 1 MCS: 0-9
		NSS: 2 MCS: 0-9
	Supported VHT (rx) Rates:
		NSS: 1 MCS: 0-9
		NSS: 2 MCS: 0-9

Your WAN inteface is a DHCP client so should work.

Alternatively, you could change the IP of your router's LAN to match your network, then connect your router's LAN port to the network.

1 Like

I also plan on using the router as a wireless repeater, as the router will be put in a place thats far away from the main router (far enough away that I don't have any ethernet cables that are long enough at the moment).

I suppose it would be alright to temporarily bring the router closer then connect it over ethernet then install LUCI to make it easier to configure it as a wireless repeater, but I was also hoping I could just do both things at the same time while in the routers console.

If both devices (and software) support WDS then this is the most straightforward way (unless you need to have the secondary router on its own network, in which way you will go for the wwan route.

If you can't use WDS then you could try trelay and the likes.

It might be easier to do it via LuCI if you don't know all commands. Either way, avoid editing config files manually.

That's already a really complicated configuration. A vanilla install starts with two networks: lan and wan, and not much more. Ways to temporarily connect to the Internet are (in approximate order of complexity):

  • Place an Ethernet port in the wan network (which is already proto dhcp) and plug in to the other network. IP ranges of wan and lan must not overlap. Change LAN IP if necessary.
  • Configure lan network as static IP within the upstream network, disable its DHCP server and connect Ethernet to existing network. Gateway and dns must also be specified, usually they point to the main router.
  • Create wifi sta with credentials to connect to existing wifi network, and attach it to wan network. Remove any Ethernet port from the wan network-- the wifi sta must be the only thing in the network and the network can't be a bridge. It is not necessary to create new networks. Something that commonly trips up rookies is that you use option network in /etc/config/wireless to associate wifi interfaces to networks. Don't reference wifi networks in /etc/config/network.

It's Broadcom wireless which could have additional complications.

Wherever you got that firmware from needs to provide a package repository. Packages should match the built version, especially kmods which need to match exactly.

1 Like