Correct DNS settings for static WAN IP?

If your problem doesn't fall into one of the other categories, report it here.

Moderator: Moderators

Post Reply
westbywest
Posts: 14
Joined: Wed Feb 11, 2009 6:24 pm

Correct DNS settings for static WAN IP?

Post by westbywest »

I just got Gargoyle beta4 working on a Fonera+, model # 2201.

I needed to set the router to a static WAN IP, so I had to manually add the gateway to /etc/config/network, as described in this post:
http://gargoyle-router.com/phpbb/viewto ... tatic#p150

However, I'm confused about the proper place for the DNS settings. Gargoyle puts the DNS server entries in the LAN interface in /etc/config/network, while OpenWRT puts them in the WAN, as shown here:

Code: Select all

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

config 'interface' 'lan'
	option 'type' 'bridge'
	option 'proto' 'static'
	option 'ipaddr' '192.168.1.1'
	option 'netmask' '255.255.255.0'
	option 'ifname' 'eth0.0'

config 'interface' 'wan'
	option 'ifname' 'eth0.1'
	option 'proto' 'static'
	option 'ipaddr' 'X.X.X.X'
	option 'netmask' '255.255.255.0'
        option gateway  'X.X.X.X'
        option dns      'X.X.X.X X.X.X.X'
The Gargoyle router would not properly route between LAN and WAN without the gateway value specified manually, and I also put the DNS entries in the wan interface. This seems to work, but I don't know if this configuration is supported by Gargoyle specifically. I.e., will I clobber /etc/config/network if I change something via the web interface now?

Can anyone verify proper DNS configuration when your Gargoyle router is set to use a static WAN IP?

FRiC
Posts: 62
Joined: Sat Sep 27, 2008 8:03 am
Contact:

Re: Correct DNS settings for static WAN IP?

Post by FRiC »

Entering the DNS server entries using the Gargoyle UI (and therefore in the LAN section) does work though. I "think" it's a mistake in the UI, since the WAN DNS should only be an available option if static IP is chosen, and the LAN DNS should be a "static DNS" option that are passed onto DHCP clients. (i.e., don't use the router as the DNS.)

Changing settings in the Gargoyle UI will only affect settings that are available in the UI, since it's passing uci commands to the router, and not writing the config files manually.

This is what mine looks like:

Code: Select all

config 'interface' 'lan'
        option 'type' 'bridge'
        option 'ifname' 'eth0.0'
        option 'proto' 'static'
        option 'ipaddr' '192.168.1.1'
        option 'netmask' '255.255.255.0'
        option 'dns' '192.168.1.1 203.121.130.20 203.121.130.30 '

config 'interface' 'wan'
        option 'ifname' 'eth0.1'
        option 'proto' 'static'
        option 'ipaddr' 'xxx.xxx.xx.2'
        option 'netmask' '255.255.255.240'
        option 'gateway' 'xxx.xxx.xx.1'

Eric
Site Admin
Posts: 1443
Joined: Sat Jun 14, 2008 1:14 pm

Re: Correct DNS settings for static WAN IP?

Post by Eric »

There really isn't much difference in specifying the DNS servers in the WAN vs the LAN. In both cases it works.

The reason I put them in the LAN and not the WAN is that this way, if the wan interface is disabled, you can still specify DNS servers properly. I suppose I could put another DNS option for the WAN if there is a static IP but this seems a bit redundant and might be confusing. What do you think?

The best solution may be to require the specification of a DNS server if the WAN has a static IP. Right now, not specifying a DNS server is valid, as in most configurations these are optional.

Also, the WAN gateway option has been added in the SVN, and a new experimental version is available, if you're interested. Sorry about this gateway issue -- I don't know how I overlooked it in the first place. The new, experimental build for broadcom can be downloaded here, and you can find the new squashfs/kernel files for atheros here and here.

FRiC
Posts: 62
Joined: Sat Sep 27, 2008 8:03 am
Contact:

Re: Correct DNS settings for static WAN IP?

Post by FRiC »

You're right, having two DNS would be redundant. I think it was just a bit confusing for me for it to be in the LAN section. But is there any actual difference whether it's in the WAN or LAN section, if both ways work the same?

I'm testing the new beta-4.6 firmware as I write this. I think it needs a "WAN Gateway" display in the status page. ;)

belainex
Posts: 5
Joined: Fri Nov 06, 2009 6:44 am

Re: Correct DNS settings for static WAN IP?

Post by belainex »

What is the advantage of using dynamic dns? I have noticed my Belkin router has an option to use dynamic dns. What are the pros and cons of using this service?
____________________
external keyword tool ~ keyworddiscovery.com ~ keycompete.com ~ compete.com ~ webmasterworld.com
Last edited by belainex on Sat Nov 14, 2009 7:02 am, edited 1 time in total.

Lucky75
Posts: 83
Joined: Tue Mar 31, 2009 5:04 pm

Re: Correct DNS settings for static WAN IP?

Post by Lucky75 »

If you have a dynamic IP from your ISP, you can have your router update your current IP and send it to dyndns for example so you can always have a valid domain name pointing to your network.

Post Reply