How to get internet on openwrt?

With a static WAN configuration you also have to specify a DNS server.

To diagnose if the problem is lack of DNS, try to ping a well-known site by number, such as 8.8.8.8. If that works you have Internet access, but DNS may be broken. Try again pinging the same site by its name, which is dns.google.

1 Like

why you starting crying about? you got hurt because i said it was crap? if that so, then the problem is you. all im wondering about is why it so much chaos about openwrt

i chose both 8.8.8.8 and 1.1.1.1

i wrote "Why it's not working and multiple people trying to help me on 4 different forum and ssh etc " so i think that means i want help... and thats whining? saying Why it's not working and multiple people trying to help me on 4 different forum and ssh etc .. my bad

There isn't. It works fine for plenty of people. Where it doesn't is usually down to user error.

As it is, you've posted 15 times so far. 3 (maybe) have included info that might be useful for troubleshooting. You've been given clear information on what further we need and where to get it, but you haven't done that. You instead felt it was more appropriate to make more useless (for the purposes of getting assistance) posts.

I (and plenty of others) are happy to help and give a fair amount of time to assisting people. But that also requires people to help themselves. If they don't want to do that then it's nice to get an early heads up so we don't waste our time.

Where it doesn't is usually down to user error. thats what so bad about it (sorry i'm just being honest) like i said only 2 lines on the router before i messed up by installing openwrt.. but okok... i google it and thousands have the same problem isee .. i upload more picture tomorow

Don't. Do what you've been asked and paste the output from the ssh commands. If we wanted pictures we'd have asked for pictures.

1 Like

If (and it isn't clear here) you're saying that pinging numeric IPs does not work, the next test is to traceroute to a numeric IP. If you see the request leave your router and go a couple of steps into the ISP's routers, but then stop, this means that the ISP is denying your connection and you need to talk to them to find out why.

1 Like

You need to assign new WAN to WAN firewall zone (in interface/edit/firewall) so that frame around network turns red-pink
Highly advisable to keep original wan-s around until you get yours up running and remove after, so you have ref to look at.

2 Likes

Wow yes I didn't even notice that a new interface had been created. Although OP said their configuration was "just two lines" different from default.

1 Like

3 lines - ip, mask, gateway
2 lines - dns servers
1 line - fw zone
:slight_smile:

Hi

i don't own this device, but ... according to your picture
lan = eth0.1
wan = eth0

maybe i am wrong, but from eth0.1 i suppose it is "swconfig" device
and original config was
lan eth0.1
wan eth0.2
anyway, how things are now, it is impossible to work
eth0.1 and eth0
furthermore, plain eth0 is not what you think it is, it is only CPU to SWITCH connection, and not RJ45port

please, reset router to default
then leave WAN interface as it is (eth0.2) and only change protocol to static, input GW and DNS
all other settings are good by default

3 Likes

This must be a heavily modified config setup for at least both network and firewall or it ain't OpenWrt to begin with because we never have a wan2 interface by default.

We have a wan and wan6 interface and lan interface by default. And lan is hardcoded to be green and wan is hardcoded to be red, and this is impossible to change (we have treads about this color schemes).

What other four forums are you talking in?

3 Likes

2 lines was on the dlink before openwrt, read carefully..

root@OpenWrt:~# ubus call system board
{
        "kernel": "5.15.134",
        "hostname": "OpenWrt",
        "system": "Qualcomm Atheros QCA956X ver 1 rev 0",
        "model": "D-Link DIR-842 C3",
        "board_name": "dlink,dir-842-c3",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "23.05.0",
                "revision": "r23497-6637af95aa",
                "target": "ath79/generic",
                "description": "OpenWrt 23.05.0 r23497-6637af95aa"
        }
}
root@OpenWrt:~# cat /etc/config/network

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 'fdcf:a4d8:9716::/48'

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

config device
        option name 'eth0.1'
        option macaddr '00:ad:24:4e:a1:88'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config device
        option name 'eth0.2'
        option macaddr '00:ad:24:4e:a1:8a'

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 '1 2 3 4 0t'

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

root@OpenWrt:~# cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'pci0000:00/0000:00:00.0'
        option channel '36'
        option band '5g'
        option htmode 'VHT80'
        option disabled '1'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'

config wifi-device 'radio1'
        option type 'mac80211'
        option path 'platform/ahb/18100000.wmac'
        option channel '1'
        option band '2g'
        option htmode 'HT20'
        option disabled '1'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'

root@OpenWrt:~# cat /etc/config/dhcp

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'
        option dhcpv6 'server'
        option ra 'server'
        option ra_slaac '1'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'

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'

root@OpenWrt:~# cat /etc/config/firewall
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  00:11:22:33:44:66
#       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  00:11:22:33:44:55
#       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  00:11:22:33:44:55
#       option src_port         1024
#       option src_dport        80
#       option dest_ip  194.25.2.129
#       option dest_port        120
#       option proto    tcp

Looks like a default configuration.

What is immediately upstream of your OpenWrt router? Is it a cable modem? DSL modem? Fiber ONT? Another router?

its on a work space, its goes to a modem isp i think, im not sure where it goes actually.. but it worked before, and i have internet on another router with only the 2 lines of ip to isp..

you think ?

is that router also configure with a static WAN IP towards the modem ?

please come back when you don't think, but know ...

Well, it's pretty important to know what's upstream because you need to know what the connection protocol and requirements are.

Plug the cable into your wan and then run these two commands:

logread -e udhcpc
ifstatus wan | grep address

https://imgur.com/cVG5O0B
https://imgur.com/q3NEWj0
https://imgur.com/3dtdvCe