[Openwrt Project Development Notes]: ddns settings (5)

Source: Internet
Author: User

In the previous section, I mainly talked about how to install the Samba server and FTP server on openwrt. In this section, I will introduce a relatively used function: ddns. Lay the foundation for remote Iot control.

Digress: The ddns settings are simple. However, due to the reason why my path is in the real environment and my personal abilities are limited, I have never been able to achieve my intended purpose. I feel a little tired.

OK. Let's get down to the truth and get rid of it!

1. Install the ddns Service

opkg updateopkg install ddns-scripts luci-app-ddns

 

2. Register a dynamic domain name

There are too many options for dynamic Domain Name Service Providers. I will not recommend which one I choose. In this article, I will only use the changeip.com domain name. The changeip website is as follows:

https://www.changeip.com/

 

Click Create account to register an account:

 

Click Login to go to the following page:

 

Select a free ddns instance:

After the selection, the following page is displayed:

Enter your personal information.

 

Finally, you can manage dynamic domain names through the management interface. For example, on the home interface, click "DNS manager" in the figure ":

Go to the Management page:

 

Click two connections respectively:

The following results are displayed:

3. Use ddns and set 

1. Set/etc/config/ddns

Config 'service' myddns 'option' interface ''wan '# select an interface, Wan, lan option 'check _ interval '10' # Check IP address change interval option 'check _ unit ''minutes' # Check IP address change time unit option 'enabled' '1' # enable option 'IP _ source' 'web' # IP source (network, interface, URL) Option 'service _ name' 'changeip. com '# Select Service Provider Option 'domain' 'xxxxxxxxxxxx' # XXXXXXXX dynamic domain name option 'username' 'yyyy' # yyyyyy username option 'Password' 'zzzzzzz' # zzzzzzzz password option 'ip _ URL' 'Http: // [username]: [Password] @ nic.changeip.com/nic/update? U = [username] & P = [Password] & cmd = Update & hostname = [domain] & IP = [IP] "'# IP update URL option 'force _ interval' '2' # force Update Interval option 'force _ unit' 'minutes '# force Update Interval Unit

2. trigger event for adding IP address changes of ddns

Enter/etc/hotplug. d/iface/and add a 30-ifup.sh. Check the ipsettings once the network changes.

#!/bin/sh# wan ifup
password=XXXXXXXX
username=YYYYYYYY
ddns=ZZZZZZZZZZZ
[ $ACTION = "ifup" -a $INTERFACE = "wan" ] && { ifconfig wan >> /tmp/mail.txt cat /tmp/mail.txt | ssmtp -v [email protected]com # mail address sleep 60 cat /tmp/mail.txt | ssmtp -v [email protected]
 } wget -q -0- ‘http://nic.changeip.com/nic/update?u=$username&p=${password}&hostname=${ddns}&iffline=1‘ wget -q -0- ‘http://ip.changeip.com/‘

 

Iv. Problems and Solutions

1. Working Environment of my vro:

A. Outer-layer Internet Access Machine: It has dual NICs. inode is used for dial-up on the Internet, and network sharing is used to set network sharing for the Windows Nic and share it with the Intranet Nic. DHCP is not enabled for the Intranet Nic.

B. The intranet uses Static Routing. Multiple machines connect to the Intranet Nic of the outer Internet access machine through a switch.

C. Connect the vrowan wan to a port of the vswitch and use a static IP address. DHCP is used for the vro intranet.

After setting ddns, you can only resolve the IP address to the Internet access machine on the outermost layer.

Note: You can apply for an Internet dialing interface, and the router can connect to the dialing network port.

Solution:

Method 1: Port inode dial-up to openwrt and directly use inode to dial up the Internet.

I saw a post about inode transplantation from God on the Mount. Unfortunately, many problems occurred during the migration process ..

Method 2: Set port ing. I have not figured out this method .... Too much water -.-!!

If you have a good idea, please discuss it ~~

 

OK. The setting of ddns is now mentioned here. I am so unwilling to solve the problem !!!!

If the problem is solved later, open a single chapter to describe the solution in detail.

 

---------------------------------------------------------------

Notice: in the next section, I will introduce the installation and use of MySQL databases.

Reprint please indicate the source: http://www.cnblogs.com/double-win/ thank you!

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.