Setup as router with wan

Hi

I have Netgear R7800 and i used to use it as my main router with the stock firmware
now i have modem/router HG531 V1 that is the main ADSL line i have

HG531 v1
192.168.1.1
DHCP is disabled

Netgear R7800
took ip 192.168.1.2 from the HG531

i want R7800 to manage DHCP as 10.0.0.X for both LAN ports and WIFI

now i have WAN port connected to the HG531 and i configured lan and wifi to work the only one issue i have that when i use SSH to update packages i got failed to establish connection while i can use internt on my devices

here is my configuration
/etc/config/network

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 'fd0d:3cdb:0b28::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth1.1'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ipaddr '10.0.0.1'

config interface 'wan'
        option ifname 'eth0.2'
        option proto 'static'
        option ipaddr '192.168.1.2'
        option netmask '255.255.255.0'
        option gateway '192.168.1.1'

config interface 'wan6'
        option ifname 'eth0.2'
        option proto 'dhcpv6'
        option auto '0'

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

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

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


and for firewall
/etc/config/firewall
config defaults
        option syn_flood        1
        option input            ACCEPT
        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://dev.openwrt.org/ticket/10381
config rule
        option name             Allow-DHCPv6
        option src              wan
        option proto            udp

Thanks

Check the package feeds path in this file : /etc/opkg/distfeeds.conf
For example, for me first entry shows:
src/gz openwrt_core http://downloads.openwrt.org/releases/18.06.0/targets/x86/64/packages
I am able to do "wget http://downloads.openwrt.org/releases/18.06.0/targets/x86/64/packages"
You can try the same.

It may be that you don’t have your upstream dns set. You must manually set it, or if you set your wan to get an address via dhcp, usually the dns is set automatically.

If you SSH these on router, which does work and which doesn't?

ping openwrt.org
ping 139.59.209.225
ping 8.8.8.8

the first dosn't

root@OpenWrt:~# ping openwrt.org
ping: bad address 'openwrt.org'
root@OpenWrt:~# ping 139.59.209.225
PING 139.59.209.225 (139.59.209.225): 56 data bytes
64 bytes from 139.59.209.225: seq=0 ttl=50 time=62.867 ms
64 bytes from 139.59.209.225: seq=1 ttl=50 time=60.597 ms
64 bytes from 139.59.209.225: seq=2 ttl=50 time=60.334 ms
^C
--- 139.59.209.225 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 60.334/61.266/62.867 ms
root@OpenWrt:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=51 time=46.465 ms
64 bytes from 8.8.8.8: seq=1 ttl=51 time=45.450 ms
64 bytes from 8.8.8.8: seq=2 ttl=51 time=80.813 ms
64 bytes from 8.8.8.8: seq=3 ttl=51 time=45.229 ms
64 bytes from 8.8.8.8: seq=4 ttl=51 time=45.331 ms
c64 bytes from 8.8.8.8: seq=5 ttl=51 time=45.496 ms
^C
--- 8.8.8.8 ping statistics ---
6 packets transmitted, 6 packets received, 0% packet loss
round-trip min/avg/max = 45.229/51.464/80.813 ms
root@OpenWrt:~#
vi /etc/opkg/distfeeds.conf
src/gz openwrt_core http://downloads.openwrt.org/releases/18.06.2/targets/ipq806
src/gz openwrt_base http://downloads.openwrt.org/releases/18.06.2/packages/arm_c
src/gz openwrt_luci http://downloads.openwrt.org/releases/18.06.2/packages/arm_c
src/gz openwrt_packages http://downloads.openwrt.org/releases/18.06.2/packages/a
src/gz openwrt_routing http://downloads.openwrt.org/releases/18.06.2/packages/ar
src/gz openwrt_telephony http://downloads.openwrt.org/releases/18.06.2/packages/
~
~

How to set upstream DNS?

Update

yes this solve it i add dns forwarding on network>>DNS and DHCP that's work

Thanks

In network config , for wan, put this:

option dns '8.8.8.8 8.8.4.4'

Hi

it is already there

I don't see it here:

config interface 'wan'
option ifname 'eth0.2'
option proto 'static'
option ipaddr '192.168.1.2'
option netmask '255.255.255.0'
option gateway '192.168.1.1'

mmm

you are right but the problem solved by adding DNS to dns and Dhcp
is this the same?

When you are familiar with the firmware, you may want to look into setting your HG531 in bridge mode and have your R7800 WAN as PPPoE, unless you have a reason to have your HG531 doing NAT as well.

mmm

Actually nothing to do with the HG531 NAT and i was considering doing that
but if i do like you said what is the different?

Well, now you are doing double NAT. It doesn't harm much but it adds unnecessary complexity that could make certain functions difficult.

If you have your system running now you can keep it like this, but consider that change when convenient.

Well, i did it but i know now what i'm missing
i miss the ADSL line details like max downstream-downstream-upstream-CRC-Erros-Line attenuation-SNR
and i don't know how to show it in openwrt

No, in a bridge mode, the modem will take care of the xDSL encapsulation, and deliver PPPoE to the router. On the router, you will only need ISP username, password and MTU.

mmm
For now i'm missing this data as internet here is unstable also the modem is no longer accessible

can i access it or should i revert to old settings?

I don't understand what settings you have now or what do you mean by old settings. Did you change anything after you set DNS and got it working?

Old settings = double NAT
New settings = setting opwrt as PPPOE

I see.

So I imagine you changed your HG531 to bridge mode? Did you copy the MTU value as well, along with username and password, or did you left MTU in OpenWrt as default?