Dynamic DNS Improvements

The latest news about Gargoyle

Moderator: Moderators

uncle john
Posts: 146
Joined: Sun Jun 21, 2009 11:27 pm
Location: Australia

Re: Dynamic DNS Improvements

Post by uncle john »

For your public (dynamic) IP to appear at the WAN interface of a router you need to setup the router connection for PPPoE. This involves configuring the upstream modem/router for bridge mode.
I find that it is easier to follow what is going on if you do this setup in two steps:
1. Configure your modem/router for bridge mode operation. Leaving the downstream router (e.g. Gargoyle or dd-wrt etc.) disconnected, connect the modem/router directly to your PC and ensure that you can satisfactorily achieve a connection using the PC's PPPoE client.
2. Next, set up the downstream router to make a PPPoE connection and connect it the modem/router.

hako
Posts: 2
Joined: Sat Sep 05, 2009 11:50 pm

Re: Dynamic DNS Improvements

Post by hako »

uncle john wrote:...you need to setup the router connection for PPPoE....
That's what I did, and the correct WAN IP appears in the router's status screen.

My problem is that DD-WRT's inadyn cannot be configured to use that WAN IP to update the DDNS provider; inadyn can only use web ip checkers which in my case all return wrong IPs (different IP checkers produce different results, but no one is right). Probably the special routing here in China plays a role in this behavior.

So, I need to update my DDNS with the router's WAN IP. In the moment I do that manually, it works.
But, it would be nice to give this task to the router...
So, again: Can Gargoyle's DDNS updater use the router's WAN IP?

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

Re: Dynamic DNS Improvements

Post by Eric »

It's possible to do what you want, but you can't do it via the web interface alone: you'll need to ssh in and edit a config file via the command line.

First configure via the web GUI -- this should give you a config file to start from (but one that initially will update the IP from the internet, not the WAN). To do what you want, ssh into the router and edit /etc/config/ddns_gargoyle. Then for each service you have configured replace the line:

Code: Select all

	option 'ip_source' 'internet'
with these two lines:

Code: Select all

	option 'ip_source' 'network'
	option 'ip_network' 'wan'

If you reconfigure your ddns service via the web gui you will have to re-edit these lines again to make this work.

uncle john
Posts: 146
Joined: Sun Jun 21, 2009 11:27 pm
Location: Australia

Re: Dynamic DNS Improvements

Post by uncle john »

Eric: Thanks for the clarification. I was under the impression that Gargoyle used WAN IP by default. That's why I set mine up for PPPoE.
Hako: I have a friend who lived in China for a few years. He indicated that they can make internet use very frustrating.

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

Re: Dynamic DNS Improvements

Post by Eric »

I've been tearing my hair out trying to replicate the problem with forcing DNS to those servers specified by the router. It seems to be working fine for me (but no one else....).

Could someone who is experiencing this problem enable custom DNS, browse to a couple websites to send some DNS packets through the network, then ssh into the router and run the following command:

Code: Select all

iptables -t nat -L -v
and then either post the output here, or PM me with this output?

The output of:

Code: Select all

uci show network
would also be helpful to help diagnose what is going on.

User avatar
DoesItMatter
Moderator
Posts: 1373
Joined: Thu May 21, 2009 3:56 pm

Re: Dynamic DNS Improvements

Post by DoesItMatter »

Here's the dump's you requested from above...

My NIC going to the Fonera has following settings

IP: 192.168.1.250
SM: 255.255.255.0
GW: 192.168.1.1
DNS: 192.168.1.1

Router is set to force clients to use Router DNS only
-----------------------------------

Code: Select all

root@OpenWrt:~# iptables -t nat -L -v
Chain PREROUTING (policy ACCEPT 61232 packets, 5998K bytes)
 pkts bytes target     prot opt in     out     source               destination                                                                                                   
    2   311 zone_wan_prerouting  all  --  eth0.1 any     anywhere             an                                                                                                  ywhere
  619 35131 zone_lan_prerouting  all  --  br-lan any     anywhere             an                                                                                                  ywhere
  796 54741 prerouting_rule  all  --  any    any     anywhere             anywhe                                                                                                  re
    9  1750 DNAT       all  --  eth0.1 any     anywhere             anywhere                                                                                                              to:192.168.1.250

Chain POSTROUTING (policy ACCEPT 630 packets, 52501 bytes)
 pkts bytes target     prot opt in     out     source               destination                                                                                                   
  903 47355 postrouting_rule  all  --  any    any     anywhere             anywh                                                                                                  ere
  901 47275 zone_wan_nat  all  --  any    any     anywhere             anywhere                                                                                                   

Chain OUTPUT (policy ACCEPT 317 packets, 22384 bytes)
 pkts bytes target     prot opt in     out     source               destination                                                                                                   

Chain pf_loopback_A (1 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                   

Chain pf_loopback_C (1 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                   

Chain postrouting_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                   
  259 10619 pf_loopback_C  all  --  any    br-lan  anywhere             anywhere

Chain prerouting_lan (1 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                   

Chain prerouting_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                   

Chain prerouting_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                   

Chain zone_lan_nat (0 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                   
    0     0 MASQUERADE  all  --  any    br-lan  anywhere             anywhere                                                                                                     

Chain zone_lan_prerouting (1 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                   
  186 11851 REDIRECT   udp  --  any    any     anywhere             anywhere                                                                                                              udp dpt:53
    0     0 REDIRECT   tcp  --  any    any     anywhere             anywhere                                                                                                              tcp dpt:53
    0     0 pf_loopback_A  all  --  any    any     anywhere             192.168.                                                                                                  11.2
  433 23280 prerouting_lan  all  --  any    any     anywhere             anywher                                                                                                  e

Chain zone_wan_nat (1 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                   
  618 35324 MASQUERADE  all  --  any    eth0.1  anywhere             anywhere                                                                                                     

Chain zone_wan_prerouting (1 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                   
    2   311 prerouting_wan  all  --  any    any     anywhere             anywher                                                                                                  e
         
-------------------------

root@OpenWrt:~# uci show network
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.lan=interface
network.lan.type=bridge
network.lan.proto=static
network.lan.ipaddr=192.168.1.1
network.lan.netmask=255.255.255.0
network.lan.ifname=eth0.0
network.lan.dns=128.107.241.185 67.138.54.100 208.67.220.220 208.67.222.222
network.wan=interface
network.wan.ifname=eth0.1
network.wan.proto=static
network.wan.ipaddr=192.168.11.2
network.wan.netmask=255.255.255.0
network.wan.gateway=192.168.11.1
network.wan.dns=128.107.241.185 67.138.54.100 208.67.220.220 208.67.222.222
Last edited by DoesItMatter on Mon Sep 07, 2009 1:11 pm, edited 1 time in total.
:twisted: Soylent Green Is People! :twisted:
2x Asus RT-N16 = Asus 3.0.0.4.374.43 Merlin
2x Buffalo WZR-HP-G300NH V1 A0D0 = Gargoyle 1.9.x / LEDE 17.01.x
2x Engenius - ESR900 Stock 1.4.0 / OpenWRT Trunk 49400

BikeMike
Posts: 108
Joined: Sat Jun 13, 2009 8:02 am
Location: Adelaide, South Australia

Re: Dynamic DNS Improvements

Post by BikeMike »

Here's my output from the commands above, just a few things replaced by asterisks.

Code: Select all

login as: root
password:


BusyBox v1.11.2 (2009-08-26 19:46:10 EDT) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 KAMIKAZE (8.09.1, unknown) ----------------------------
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
 ---------------------------------------------------
root@WRT54GL:~# iptables -t nat -L -v
Chain PREROUTING (policy ACCEPT 125K packets, 20M bytes)
 pkts bytes target     prot opt in     out     source               destination 
 5138  405K zone_wan_prerouting  all  --  ppp0   any     anywhere             anywhere
59672 7325K zone_lan_prerouting  all  --  br-lan any     anywhere             anywhere
49693 6734K prerouting_rule  all  --  any    any     anywhere             anywhere

Chain POSTROUTING (policy ACCEPT 1373 packets, 173K bytes)
 pkts bytes target     prot opt in     out     source               destination 
48905 2783K postrouting_rule  all  --  any    any     anywhere             anywhere
48905 2783K zone_wan_nat  all  --  any    any     anywhere             anywhere 

Chain OUTPUT (policy ACCEPT 38688 packets, 2628K bytes)
 pkts bytes target     prot opt in     out     source               destination 

Chain pf_loopback_A (1 references)
 pkts bytes target     prot opt in     out     source               destination 
    0     0 DNAT       tcp  --  any    any     anywhere             anywhere            tcp dpts:5060:5061 to:192.168.10.252:5060-5061
    0     0 DNAT       udp  --  any    any     anywhere             anywhere            udp dpts:5060:5061 to:192.168.10.252:5060-5061

Chain pf_loopback_C (1 references)
 pkts bytes target     prot opt in     out     source               destination 
    0     0 MASQUERADE  tcp  --  any    any     192.168.10.0/24      192.168.10.252      tcp dpts:5060:5061
    0     0 MASQUERADE  udp  --  any    any     192.168.10.0/24      192.168.10.252      udp dpts:5060:5061

Chain postrouting_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination 
  109 36479 pf_loopback_C  all  --  any    br-lan  anywhere             anywhere

Chain prerouting_lan (1 references)
 pkts bytes target     prot opt in     out     source               destination 

Chain prerouting_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination 

Chain prerouting_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination 

Chain quota_redirects (1 references)
 pkts bytes target     prot opt in     out     source               destination 
    0     0 REDIRECT   tcp  --  any    any     *****                anywhere            multiport dports 80,443 bandwidth --check --id 192.168.10.101_combined
    0     0 REDIRECT   tcp  --  any    any     ******               anywhere            multiport dports 80,443 bandwidth --check --id 192.168.10.102_combined
    0     0 REDIRECT   tcp  --  any    any     Spare                anywhere            multiport dports 80,443 bandwidth --check --id 192.168.10.103_combined
    0     0 REDIRECT   tcp  --  any    any     ******               anywhere            multiport dports 80,443 bandwidth --check --id 192.168.10.104_combined
    0     0 REDIRECT   tcp  --  any    any     ******                anywhere            multiport dports 80,443 bandwidth --check --id 192.168.10.105_combined
    0     0 REDIRECT   tcp  --  any    any     Mike                 anywhere            multiport dports 80,443 bandwidth --check --id 192.168.10.120_combined
    0     0 REDIRECT   tcp  --  any    any     Mike                 anywhere            multiport dports 80,443 bandwidth --check --id 192.168.10.121_combined
    0     0 REDIRECT   tcp  --  any    any     Mike                 anywhere            multiport dports 80,443 bandwidth --check --id 192.168.10.122_combined
    0     0 REDIRECT   tcp  --  any    any     192.168.10.251       anywhere            multiport dports 80,443 bandwidth --check --id 192.168.10.251_combined
    0     0 REDIRECT   tcp  --  any    any     192.168.10.252       anywhere            multiport dports 80,443 bandwidth --check --id 192.168.10.252_combined
    0     0 REDIRECT   tcp  --  any    any     192.168.10.125       anywhere            multiport dports 80,443 bandwidth --check --id 192.168.10.125_combined
    0     0 REDIRECT   tcp  --  any    any     anywhere             anywhere            multiport dports 80,443 bandwidth --check --id ALL_OTHERS_COMBINED_combined

Chain zone_lan_nat (0 references)
 pkts bytes target     prot opt in     out     source               destination 
    0     0 MASQUERADE  all  --  any    br-lan  anywhere             anywhere   

Chain zone_lan_prerouting (1 references)
 pkts bytes target     prot opt in     out     source               destination 
15119  997K REDIRECT   udp  --  any    any     anywhere             anywhere            udp dpt:53
    0     0 REDIRECT   tcp  --  any    any     anywhere             anywhere            tcp dpt:53
44553 6328K quota_redirects  all  --  any    any     anywhere             anywhere
    0     0 pf_loopback_A  all  --  any    any     anywhere             219-90-253-254.ip.adam.com.au
44553 6328K prerouting_lan  all  --  any    any     anywhere             anywhere

Chain zone_wan_nat (1 references)
 pkts bytes target     prot opt in     out     source               destination 
48376 2719K MASQUERADE  all  --  any    ppp0    anywhere             anywhere   

Chain zone_wan_prerouting (1 references)
 pkts bytes target     prot opt in     out     source               destination 
 5138  405K prerouting_wan  all  --  any    any     anywhere             anywhere
    0     0 DNAT       tcp  --  any    any     anywhere             anywhere            tcp dpts:5060:5061 to:192.168.10.252:5060-5061
    0     0 DNAT       udp  --  any    any     anywhere             anywhere            udp dpts:5060:5061 to:192.168.10.252:5060-5061
root@WRT54GL:~# uci show network
network.eth0=switch
network.eth0.vlan0=0 1 2 3 5*
network.eth0.vlan1=4 5
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.lan=interface
network.lan.type=bridge
network.lan.ifname=eth0.0
network.lan.proto=static
network.lan.netmask=255.255.255.0
network.lan.ipaddr=192.168.10.254
network.lan.dns=208.67.222.222 208.67.220.220
network.wan=interface
network.wan.ifname=eth0.1
network.wan.proto=pppoe
network.wan.username=******
network.wan.password=******
network.wan.keepalive=3 5
network.wan.dns=208.67.222.222 208.67.220.220
root@WRT54GL:~#

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

Re: Dynamic DNS Improvements

Post by Eric »

DoesItMatter: I notice that you have both Cisco DNS servers as well as OpenDNS servers specified. To use OpenDNS, you will have to use only their DNS servers. If you specifiy just the OpenDNS servers and then go to opendns.com, does it say that you're using OpenDNS?

BikeMike: I really don't see any problems with your setup... it seems fine. When you visit opendns.com, it tells you that you aren't using OpenDNS? If it doesn't work with those settings, could you please ssh into your router and send me the output of:

Code: Select all

cat /tmp/resolv.conf.auto
Thanks!

User avatar
DoesItMatter
Moderator
Posts: 1373
Joined: Thu May 21, 2009 3:56 pm

Re: Dynamic DNS Improvements

Post by DoesItMatter »

Eric wrote:DoesItMatter: I notice that you have both Cisco DNS servers as well as OpenDNS servers specified. To use OpenDNS, you will have to use only their DNS servers. If you specifiy just the OpenDNS servers and then go to opendns.com, does it say that you're using OpenDNS?
I'm not sure?

I don't use any 3rd party service or have an account there.

I can use any of these servers without logging into them.
I've tested it before. I just pick something that's going to have
the highest uptime, which is why I have the Cisco DNS as #1 :D.

I don't require any features or enhancements of a 3rd party
DNS, I just need them as lookups. I only have that configured
on the test Fonera anyway. I usually use my ISP's DNS normally.

I'm in one of the rare situations where I can have 2 cable-modem
ISP's connected to my house at once, so that if one goes down,
the other one is available. None of them filter anything so I don't
have to worry about censorship. And each of them have a limit of
250 GB per month per ISP, which means I could probably download
up to 500 GB per month, which I would never hit.
At the most, I think I maybe hit 50-100 GB per ISP, and that would
have only been once or twice in a while.

I'm just having fun doing the testing and playing around with stuff!
:twisted: Soylent Green Is People! :twisted:
2x Asus RT-N16 = Asus 3.0.0.4.374.43 Merlin
2x Buffalo WZR-HP-G300NH V1 A0D0 = Gargoyle 1.9.x / LEDE 17.01.x
2x Engenius - ESR900 Stock 1.4.0 / OpenWRT Trunk 49400

uncle john
Posts: 146
Joined: Sun Jun 21, 2009 11:27 pm
Location: Australia

Re: Dynamic DNS Improvements

Post by uncle john »

Eric wrote:I've been tearing my hair out trying to replicate the problem with forcing DNS to those servers specified by the router.
Oh, sorry about that :cry:. I'll do my best to help solve this.
At the risk of making a stupid comment (again), I've noticed that if I connect via DHCP things work as expected. I only get this problem with PPPoE.
I'll have a bit more time tomorrow to delve a little deeper and run the commands you've requested.

Post Reply