[Solved] Newbie: Why this opkg fail?

Hi guys, my first post here. I have a lot of Linux and Mac experience but I'm new to working on remote servers via PuTTY.

I just installed LEDE on an out-of-the-box GL.inet MT300A. As per instructions, I linked to the MT300A via an Ethernet cable and used the onboard software to flash the LEDE image. The upgrade went fine and the device is now running on my home network via an Ethernet lead into the house router.

I'm now proceeding with the installation of a LAMP stack as per the instructions on this site. uhttpd was installed during the upgrade and is running well. I moved on to PHP installation, but it seems that opkg can't access the repository, although I can see it fine from the same network. I can't easily copy-paste the PuTTY output on this computer, but what I get is four successive instances of 'Failed to establish connection' -- presumably for four URLs -- plus a 'collected errors' section that confirms the four fails.

Sorry if this is a boring question, but it's pretty live for me (and isn't in the FAQ...)

Best, NP

First guess:
you have defined a static IP address for the new router, but you have forgotten to define DNS and gateway, which likely should be the main router of your network.

Thanks, Hnyman. Like I said, I'm clueless about networking, so I had expected those to be assigned automatically by the house router, as I imagine they are for client PCs. So, I need to explicitly specify DNS and gateway to the MT300A? Best, NP

Depends on your network settings...

Likely all the client devices use DHCP to get the IP address from the main router, and they get DNS and gateway at the same time.

But if you have explicitly defined an IP address for the MT300A and it does nto use DHCP, then you naturally need to specify also the gateway and DNS server address for it.

Hi all and especially Hnyman,

I'm embarrassed to be asking this question, as I could likely answer it for myself with Googling and experimentation. But I imagine that an experienced LEDE user could look at my configuration and tell me the cause of my problem in 30 seconds. So, if anyone wants to save me a couple of hours...

My home network is an out-of-the-box British Telecom router in default settings. It has a local IP address of 192.168.1.254 and is configured for a gateway at 217.32.141.34 and DNS at 213.120.234.46.

I just added a LEDE-equipped GL.inet MT300A at 192.168.1.1. I can see it on the local network, and can access its webserver. But it can't see the LEDE repository on the Internet, despite my careful UCI setup.

Here's the output of uci show network. What am I doing wrong?

network.loopback=interface
network.loopback.ifname='lo'
network.loopback.proto='static'
network.loopback.ipaddr='127.0.0.1'
network.loopback.netmask='255.0.0.0'
network.globals=globals
network.globals.ula_prefix='fd32:5a4c:75bc::/48'
network.lan=interface
network.lan.type='bridge'
network.lan.ifname='eth0.1'
network.lan.proto='static'
network.lan.ipaddr='192.168.1.1'
network.lan.netmask='255.255.255.0'
network.lan.ip6assign='60'
network.lan.gateway='192.168.1.254'
network.lan_dev=device
network.lan_dev.name='eth0.1'
network.lan_dev.macaddr='e4:95:6e:42:c0:13'
network.wan=interface
network.wan.ifname='eth0.2'
network.wan.dns='213.120.234.46'
network.wan.netmask='255.255.255.0'
network.wan.gateway='217.32.141.34'
network.wan.proto='dhcp'
network.wan_dev=device
network.wan_dev.name='eth0.2'
network.wan_dev.macaddr='e4:95:6e:42:c0:14'
network.wan6=interface
network.wan6.ifname='eth0.2'
network.wan6.proto='dhcpv6'
network.@switch[0]=switch
network.@switch[0].name='switch0'
network.@switch[0].reset='1'
network.@switch[0].enable_vlan='1'
network.@switch_vlan[0]=switch_vlan
network.@switch_vlan[0].device='switch0'
network.@switch_vlan[0].vlan='1'
network.@switch_vlan[0].ports='1 2 3 4 6t'
network.@switch_vlan[1]=switch_vlan
network.@switch_vlan[1].device='switch0'
network.@switch_vlan[1].vlan='2'
network.@switch_vlan[1].ports='0 6t'

TIA, NP

  • ...are you saying that the LAN on the British Telecom router AND the LAN on the LEDE are: 192.168.1.0/24???
  • Did you connect the LEDE via a LAN port, or the WAN port?

If both LANs have the same network range, you will have to renumber one of them.

Hi Ileachii, thank you for your fast reply. I'm in an awkward position, as I understand some server concepts very well but know very little of IP networking. (I think the LEDE documentation assumes that everyone knows IP.) So, in answer to your question:

The IP address of the BT router is presently 192.168.1.254.
The IP address of the GL/LEDE router is 192.168.1.1.
The GL/LEDE router is connected through the LAN port.

I can change the settings on the LEDE easily, but I'm shooting in the dark. Any guidance would be very welcome.

Best, NP

While this configuration allows for a LAN connection with you BT router...your problem will only be solved by setting a gateway in the LEDE LAN interface to 192.168.1.254 (the IP of the BT router's LAN).

Why?

You don't have the WAN port of the LEDE connected, and that's the default configuration on most routers for Internet access. Simply add a gateway IP to the LEDE's LAN.

Hi Ileachii,

That would be: network.lan.gateway='192.168.1.254’ ...?

I already made that setting. You can see it as part of the output of uci show network above. What am I doing wrong?

I guess I should spell out that the objective is to set up the GL/LEDE as a self-contained LAN webserver for development. But it will need Internet access for the installation of Open WRT components like PHP and so on.

Best, NP

Describe all connections to the LEDE:

  • Where is your computer connected?
  • Where is the BT router connected?

Thanks, Ileachii, you're very patient.

The BT router is connected to the phone line. Until today, that was its only hardware connection -- all devices in the house connected to it via wireless.

As of this afternoon, it is linked via one of its four ethernet ports to the LAN port of the GL/LEDE router.

Any suggestions welcome, and apologies if I'm doing something crass here...

Best, NP

You have not assigned a DNS server address for lan.
Likely it should be the main router, 192.168.1.254

So, there router itself can't find addresses.

Thanks, Hnyman, that is much appreciated. I'll try to implement now... Best, W.

If I read you explanation correctly, you have the main router at 192.168.1.254, new LEDE router at 192.168.1.1, their LAN ports are connected with wired cable. You have set gateway, but not DNS for that LAN in the LEDE router. Otherwise it looks ok at the first glance.

If you connect this way with LAN ports, the WAN port in LEDE router is unused and your config there has no actual impact.

1 Like

Hnyman, that worked first time. Can't thank you enough -- I would have got it eventually, but I reckon you saved me half a day of Googling and experimentation. Good luck and I hope to return the favour sometime. Best, W.

Did you notice that I gave that advice also already in my first message...

It is a rather typical mistake, when somebody adds a new router with statics address to an existing network.

1 Like

Yeah, I did note that. One of the problems about straying into (relatively) specialist territory is not having the basic concepts needed to make sense of the good advice. You just grab what you can and hope not to waste too much of people's time. You've been very patient1 Best, NP.

1 Like