DNS or DHCP problem? I need to manually add a DNS server in orde to visit websites

Hello,

I'm new to LEDE. But so far its really awesome, its very fast! But here some basic information. I use a WRT1900AC Version 1 with the latest LEDE version.

I have a problem with DHCP (not 100% sure). Everything gets an ipv4 adress from the DHCP. The DNS server they receive is '192.168.1.1'. But the router isn't forwarding the DNS queries. How can I fix this? I need to manually add DNS servers on every device to get internet. The problem is: I try to add it by 'Network > DHCP and DNS'. But when I add it and reboot the router. The problems stays.

There is also another small thing: When I use the 'Diagnostics > Network Utilities'. I can't ping domains but also ipadresses can't be pinged.

If you need more information please ask! I'm very happy to provide the information.

Thanks for reading,
Tom

Your router should work as a DNS server for the computers in the network. However, if you can't even PING an external IP address, then there is serious connectivity issue. How is your device connected to the internet?

Thanks for your reply @eduperez!

I have my Modem and there is my router connected to. My modem is connected to my internet-provider.

I need more information...

If you connect a computer directly to your modem, what IP address do you get? If it's in the 192.168.1.x range, then your modem is already NATing you and you need to put your router on another subnet, like 192.168.10.1 because you will have conflicts.

Sorry for the late reply. But when I connect my Macbook to the modem I get a 84.xx.xxx.xxx adress. But I restarted my modem and router again. The problem still exist, I still need to add the DNS servers manual on all devices.

My modem is in Brigde modem. This means that everything is forwarded on port 1 on my modem to the router.

I tried to test something. But the strange thing is. When I use the diagnostics tools I can't traceroute or ping a ipadress. Here are some screenshots from the Diagnostics:




If you need any more information: Please ask! I can provide you with any more information.

I also changed the dns server today on the router to Google DNS. But the problem still exist. So tonight I will check the firewall rules.

So, your router has absolutely no internet connection (ping to an IP address returns "Operation not permitted"), but devices connected to the router just need to specify a DNS to have full internet? That's quite weird...

Please, post your "/etc/config/network", and "/etc/config/firewall" files here; let us see how is your network configured.

1 Like

Can you check if there's a file like /tmp/resolv.conf.auto ? That is generated automatically and should have the DNS servers provided by your ISP. If you want to use google dns explicitly, there is a setting under "resolv and host files" called ignore resolve file. If you tick that, it will explicitly use whatever other dns forwardings you have set up. That is only for dns issues though. If you can't ping any ip address from the router, it is probably some other issue.

Maybe a stupid question, but your modem is connected with cable on the WAN port and not LAN?

Here is the 'etc/config/network'

root@Schoenzool:~# cat /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 'fd58:d38d:0457::/48'

config interface 'lan'
	option type 'bridge'
	option ifname 'eth0'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'

config interface 'wan'
	option ifname 'eth1'
	option _orig_ifname 'eth1'
	option _orig_bridge 'false'
	option proto 'dhcp'
	option delegate '0'
	option type 'bridge'

config interface 'wan6'
	option ifname 'eth1'
	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 '0 1 2 3 5'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '4 6'

Here is the '/etc/config/firewall'

config defaults
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'ACCEPT'
	option syn_flood '1'

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

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

config forwarding
	option src 'lan'
	option dest 'wan'

config rule
	option name 'Allow-DHCP-Renew'
	option src 'wan'
	option proto 'udp'
	option dest_port '68'
	option target 'ACCEPT'
	option family 'ipv4'

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'

config rule
	option name 'Allow-DHCPv6'
	option src 'wan'
	option proto 'udp'
	option src_ip 'fc00::/6'
	option dest_ip 'fc00::/6'
	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'

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'

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'

config include
	option path '/etc/firewall.user'

config zone
	option name 'newzone'
	option network ' '

config zone
	option name 'newzone2'
	option input 'ACCEPT'
	option forward 'ACCEPT'
	option network ' '
	option output 'ACCEPT'

config forwarding
	option dest 'wan'
	option src 'newzone2'

config forwarding
	option dest 'newzone2'
	option src 'lan'

I did, but the only thing I get is this:

Here is the file 'tmp/resolv.conf'

search lan
nameserver 127.0.0.1

So, if I'm correct the DNS server is localhost and not my ISP DNS. But I don't understand why. I can't find the 127.0.0.1 in any page in LEDE admin panel.

Very good question! But I only have LAN ports. Its not connected to the WAN port! Because I don't have it. We have a dutch ISP (Ziggo) that use the coax cable for Phone, Internet and TV.

I did not express myself correctly. What I meant was: Is your modem ethernet cable connected on the WAN port of the router ?

Modem <=> (WAN)Router(LAN) <=> Devices

Ok... things start to look clear now.

Your router definitively has a WAN port, and the LAN port on the modem should connect to the WAN port on the router, as @DjiPi pointed out. However, there is something in your network config file that should not be there: the WAN interface must not have "option type 'bridge'" line.

There are also some rules about "newzone" and "newzone2" in the firewall config file, that could cause trouble.

Sorry, that also my bad. The modem is connected to the WAN port on the router. [quote="eduperez, post:13, topic:5967"]
Your router definitively has a WAN port, and the LAN port on the modem should connect to the WAN port on the router, as @DjiPi pointed out. However, there is something in your network config file that should not be there: the WAN interface must not have "option type 'bridge'" line.

There are also some rules about "newzone" and "newzone2" in the firewall config file, that could cause trouble.
[/quote]

My bad, I didn't say it correctly. My Router has a WAN port but not my modem.

Is it possible to remove it with 'VI' from the file or is that not recommended? So I can make this:

config interface 'lan'
	option type 'bridge'
	option ifname 'eth0'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'

to this

config interface 'lan'
	option ifname 'eth0'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'

You can always use:

uci delete network.wan.type
uci commit

Warning: @eduperez was talking about WAN not LAN. I've adjusted the command line accordingly to reflect that.