Summary of the invention
The problems referred to above existed for existing gateway device detection method, now provide one to be intended to
Realization can the wide area of detection gateway device of reason that quickly Positioning Wide network interface breaks down
The method of network interface and gateway device.
Concrete technical scheme is as follows:
A kind of method of Wide Area Network interface detecting gateway device, is applied to gateway device and connects width
Band, comprises the steps:
Whether the network that S1. detection Wide Area Network interface connects connects, and if so, terminates;If it is not,
Perform step S2;
S2. identify described gateway device connect broadband configuration mode:
When described configuration mode is static address, perform step S3;
When described configuration mode is automatically to obtain mode, perform step S4;
When described configuration mode is broadband dial mode, perform step S6;
S3. generate and examine described gateway device IP address, subnet mask, the prompting of gateway disappear
Breath, terminates;
S4. judge whether described gateway device obtains IP address, if so, perform step S8;
If it is not, perform step S5;
S5. the most normal prompting message of detection Dynamic Host Configuration Protocol server, knot are generated
Bundle;
S6. judge whether described gateway device obtains IP address, if so, perform step S8;
If it is not, perform step S7;
S7. error code is obtained, the corresponding corresponding prompting message of each error code, according to
Corresponding described error code generates corresponding described prompting message, terminates;
S8. in described gateway device, set up the gateway IP ground being connected with described Wide Area Network interface
The domain name system server address that location is corresponding, terminates.
Preferably, before performing described step S1, also include:
A1. whether detection Wide Area Network interface is connected with broadband interface, if so, performs step S1;
If it is not, perform step A2;
A2. the prompting message connecting described Wide Area Network interface with described broadband interface, knot are generated
Bundle.
Preferably, described in described step S7, error code includes 0, or 1;
Described error code is that the prompting message of 0 correspondence is: the dialing of described gateway device is different
Often, operator please be contact;
Described error code is that the prompting message of 1 correspondence is: dial.
Preferably, described in described step S7, error code includes 646, or 647, or
648, or 649, or 678;
Described error code is 646, or 647, or 648, or the prompting message of 649 correspondences
It is: the account in broadband cannot use, bandwidth operator please be contact;
Described error code is that the prompting message of 678 correspondences is: please reinsert described wide area network
Netting twine between interface and broadband interface.
Preferably, described in described step S7, error code includes 691, or 709;
Described error code is that the prompting message of 691 correspondences is: the account in broadband or password are wrong
Miss, or broadband expires;
Described error code is that the prompting message of 709 correspondences is: the account in broadband and password are not
Join.
Preferably, include in described step S8:
S81. judge whether to obtain and be connected the gateway IP ground that described Wide Area Network interface connects
Location, if it is not, perform step S82;If so, step S83 is performed;
S82. the prompting message that please restart bandwidth operator equipment is generated, and/or
Generate the prompting message opening described gateway device hardware address cloning function,
Terminate;
S83. judge whether described gateway device exists the net being connected with described Wide Area Network interface
Close the domain name system server address that IP address is corresponding, if it is not, perform step S84;If so,
Perform step S85;
S84. generate and there is no domain name system server address, domain name system please be set up
The prompting message of server address, terminates;
S85. judge whether domain name system server address is automatically to obtain, if so, hold
Row step S82;If it is not, perform step S86;
S86. generate and advise carrying of the function cancelling self-defined domain name system server address
Show message.
Preferably, in described step S2 provide one first variable, described first variable in order to
Store described gateway device and connect the configuration mode in broadband, by checking that described first variable is to obtain
Take described gateway device and connect the configuration mode in broadband.
Preferably, in described step S4 provide one second variable, described second variable in order to
Store the IP address that described gateway device obtains, described by checking that described second variable judges
Whether gateway device obtains IP address.
Preferably, described step S6 uses offer one ternary, described ternary
In order to store the IP address that described gateway device obtains, by checking that described ternary judges
Whether described gateway device obtains IP address.
A kind of gateway device, the method inspection of the Wide Area Network interface of the detection gateway device described in employing
Survey described Wide Area Network interface.
The beneficial effect of technique scheme:
In the technical program, by identifying that gateway device connects the configuration mode in broadband, according to not
Same configuration mode carries out corresponding breakdown judge, to generate corresponding prompting message, refines
The reason broken down, can quickly position failure cause, and the used time is short, and efficiency is high.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, to the technical side in the embodiment of the present invention
Case is clearly and completely described, it is clear that described embodiment is only the present invention one
Divide embodiment rather than whole embodiments.Based on the embodiment in the present invention, this area is general
The every other enforcement that logical technical staff is obtained on the premise of not making creative work
Example, broadly falls into the scope of protection of the invention.
It should be noted that in the case of not conflicting, the embodiment in the present invention and embodiment
In feature can be mutually combined.
The invention will be further described with specific embodiment below in conjunction with the accompanying drawings, but not as this
The restriction of invention.
As it is shown in figure 1, a kind of method of Wide Area Network interface detecting gateway device, it is applied to net
Pass equipment connects broadband, comprises the steps:
Whether the network that S1. detection Wide Area Network interface connects connects, and if so, terminates;If it is not,
Perform step S2;
S2. the configuration mode in identification gateway device connection broadband:
When configuration mode is static address, perform step S3;
When configuration mode is automatically to obtain mode, perform step S4;
When configuration mode is broadband dial mode, perform step S6;
S3. generate and examine gateway device IP address, subnet mask, the prompting message of gateway,
Terminate;
S4. judge whether gateway device obtains IP address, if so, perform step S8;If it is not,
Perform step S5;
S5. the most normal prompting message of detection Dynamic Host Configuration Protocol server, knot are generated
Bundle;
S6. judge whether gateway device obtains IP address, if so, perform step S8;If it is not,
Perform step S7;
S7. error code is obtained, the corresponding corresponding prompting message of each error code, according to
Corresponding error code generates corresponding prompting message, terminates;
S8. set up corresponding with the gateway ip address that Wide Area Network interface connects in gateway device
Domain name system server address, terminates.
Further, when configuration mode is static address, static address is different from acquisition automatically
Mode and broadband dial mode, need before using to confirm whether current network is static IP network,
If it is, need to network manager examine IP address, subnet mask, gateway, first-selected DNS,
The parameters such as standby DNS.
In the present embodiment, by identifying that gateway device connects the configuration mode in broadband, according to not
Same configuration mode carries out corresponding breakdown judge, to generate corresponding prompting message, refines
The reason broken down, can quickly position failure cause, and the used time is short, and efficiency is high.
In a preferred embodiment, before performing step S1, also include:
A1. whether detection Wide Area Network interface is connected with broadband interface, if so, performs step S1;
If it is not, perform step A2;
A2. generate the prompting message of connecting wan interface and broadband interface, terminate.
In the present embodiment, when detecting that Wide Area Network interface is not connected with broadband interface, raw
Become prompting message it may also is that please one end of netting twine to be inserted in the wan interface of gateway device,
The other end is inserted on the broadband interface that bandwidth operator provides, if still cannot connect, and interchangeable one
Netting twine tries again.When wan interface has been connected with broadband interface, then detect whether network connects,
PING (detection) one designated domain name can be passed through, see and whether connect, if connection, then network
Normally.If do not connected, then need to obtain the broadband configuration mode of user.
In a preferred embodiment, error code can include 0, or 1 in the step s 7, or
646, or 647, or 648, or 649, or 678, or 691, or 709;
Error code is after 0 expression PPPoE (point-to-point protocol on Ethernet) request sends
Without response, it is likely to be due to bandwidth operator circuit unstable, causes gateway device PPPoE to dial
Number exception, need to contact bandwidth operator, and therefore error code is that the prompting message of 0 correspondence is:
The dialing of gateway device is abnormal, please contact operator;
Error code is that the prompting message of 1 correspondence is: dial;
Error code is 646, or 647, or 648, or the prompting message of 649 correspondences is:
The account in broadband cannot use, and please contact bandwidth operator;
Error code is 678 expression bandwidth operator server updatings, or netting twine loosens, and can build
View user reinserts after pulling out netting twine 10 minutes and tries, if or not all right, please contact
Bandwidth operator, therefore error code is that the prompting message of 678 correspondences is: please reinsert wide
Netting twine between territory network interface and broadband interface;
Error code is that the prompting message of 691 correspondences is: the account in broadband or code error, or
Broadband expires;
Error code is that the prompting message of 709 correspondences is: the account in broadband is not mated with password,
Or broadband password is the shortest, bandwidth operator please be contact.
As in figure 2 it is shown, in a preferred embodiment, include in step s 8:
S81. judge whether to obtain the gateway ip address being connected with connecting wan interface, if
No, perform step S82;If so, step S83 is performed;
S82. the prompting message that please restart bandwidth operator equipment is generated, and/or
Generate the prompting message opening gateway device hardware address cloning function, terminate;
S83. judge whether gateway device exists the gateway ip address being connected with Wide Area Network interface
Corresponding DNS (Domain Name System, domain name system) server address, if it is not,
Perform step S84;If so, step S85 is performed;
S84. generate and there is no domain name system server address, domain name system server ground please be set up
The prompting message of location, terminates;
S85. judge whether domain name system server address is automatically to obtain, if so, perform step
Rapid S82;If it is not, perform step S86;
S86. the prompting generating the function that self-defined domain name system server address is cancelled in suggestion disappears
Breath.
In the present embodiment, when obtaining the gateway IP ground being connected with connecting wan interface
During location, can generate and restart bandwidth operator equipment, if still cannot solve, contact width can be generated
With operator prompting message;And please attempt opening clone's merit of gateway device hardware address
Can, the prompting message of the device hardware address that clone can surf the Net.If WAN can not be detected
Interface side gateway ip address, then judge whether DNS exists, if it does not exist, then prompting " nothing
DNS, please arranges page setup DNS to outer net ".If there is and be user's manual configuration
DNS, then prompting " gateway device employs self-defined DNS, may affect online effect,
If having affected online, it is proposed that cancel self-defined DNS, if online no impact, permissible
Ignore this suggestion ".If the DNS automatically obtained, then prompting " 1 gateway device WAN
The bandwidth operator equipment that side connects cannot be surfed the Net, and please restart bandwidth operator equipment, as still
Existing problems, please contact bandwidth operator;2 please attempt opening gateway device MAC clones merit
Can, the device mac address that clone can surf the Net ".
In a preferred embodiment, provide one first variable (wan_proto) in step s 2,
First variable connects the configuration mode in broadband in order to store gateway device, by checking the first variable
To obtain the configuration mode in gateway device connection broadband.
In the present embodiment, when detecting network and whether connecting, PING (detection) can be passed through
Whether one designated domain name, see and connect, if connection, then network is normal.If do not connected, then
The broadband configuration mode of user need to be obtained.The configuration in broadband is checked by wan_proto variable
Mode is static address, and which in mode and three kinds of modes of broadband dial mode automatically obtains
Kind.
In a preferred embodiment, provide one second variable (wan_ipaddr) in step s 4,
Second variable is in order to store the IP address that gateway device obtains, by checking that the second variable judges
Whether gateway device obtains IP address.
In the present embodiment, if the configuration mode in broadband is the mode that automatically obtains, then judge
Whether wan interface side gets address
0.0.0.0 or empty, judge whether to get address).If address, wan interface side is not
Get address, then " automatic acquisition mode cannot be surfed the Net, and whether PLSCONFM first line of a couplet equipment in prompting
Open automatic acquisition mode to service ".
In a preferred embodiment, provide a ternary (wan_ipaddr) in step s 6,
Ternary is in order to store the IP address that gateway device obtains, by checking that ternary judges
Whether gateway device obtains IP address.
In the present embodiment, the second variable and ternary are identical, if the configuration mode in broadband
It is broadband dial mode, then judges whether wan interface side gets address (by judging
Whether the value of wan_ipaddr variable is 0.0.0.0 or sky, judges whether to get address).
If not getting address, then judge the reason that PPPoE dialing is failed.
The method of the Wide Area Network interface of detection gateway device is by first judging connecting wan interface
Netting twine whether access, then judge whether to access outer net, if outer net can not be accessed, then
Judge user configured connected mode, according to different configuration modes, provide different configuration mode
Under relevant issues and corresponding settling mode, with fully help user to solve cannot be wired
The problem that WAN mouth carries out surfing the Net.
A kind of gateway device, uses the method inspection of the Wide Area Network interface of above-mentioned detection gateway device
Survey Wide Area Network interface.
The foregoing is only preferred embodiment of the present invention, not thereby limit the enforcement of the present invention
Mode and protection domain, to those skilled in the art, it should can appreciate that all utilizations
Equivalent done by description of the invention and diagramatic content and obviously change gained
The scheme arrived, all should be included in protection scope of the present invention.