The network apparatus 10 includes a user interface 100, a web server 200, a wide area network (WAN) setting module 300, a DHCP setting module 400, an NAT setting module 500, a storage module 600, and a system configuration module 700.
The storage module 600 includes DHCP predefined information and NAT predefined information. In the exemplary embodiment, the DHCP predefined information includes local area network (LAN) Internet protocol (IP) address information, DHCP server enable information, DHCP server pool start/end address information, and DHCP lease time information. Accordingly, the DHCP setting module 400 can set an LAN IP address, enable a DHCP server, set DHCP server pool start/end addresses, and set a DHCP lease time according to the DHCP predefined information. In this embodiment, the DHCP server pool includes only one IP address. The IP address is assigned to a personal computer first connected to the network apparatus 10 at an LAN side of the network apparatus 10.
The NAT predefined information includes NAT enable information and a forwarding rule table 610. Accordingly, the NAT setting module 500 can enable an NAT and set the forwarding rule table 610 according to the NAT predefined information. In this embodiment, all user datagram protocol (UDP)/transport control protocol (TCP) packets can be forwarded to the one IP address in the DHCP server pool aside from packets belonging to the network apparatus 10 according to the forwarding rule table 610 of the storage module 600.
For example, if the LAN IP address is 192.168.1.1, the DHCP server start and end addresses are both 192.168.1.2 (namely the one IP address in the DHCP server pool), and the DHCP lease time is 86400 seconds, the network apparatus 10 can forward all UDP/TCP packets to the IP address 192.168.1.2 in the DHCP server pool aside from packets with UDP port 69 or TCP port 1287 from an interface ppp0 (point-to-point protocol 0), according to the settings of the fields of the forwarding rule table 610 of
Referring again to
In other embodiments, the WAN protocol message may include other protocol information, such as DHCP, static IP addresses.
In the exemplary embodiment, the user interface 100 includes an input device 110, for receiving the easy-mode enable message. In this embodiment, when a user inputs the WAN protocol message to the user interface 100 and presses the input device 110 such as a button, the web server 200 receives the WAN protocol message and the easy-mode enable message from the user interface 100. Then, the web server 200 transmits the WAN protocol message to the WAN setting module 300, and transmits the easy-mode enable message to the DHCP setting module 400 and the NAT setting module 500.
The WAN setting module 300 sets the WAN protocol message. In the exemplary embodiment, the WAN setting module 300 receives the WAN protocol message from the web server 200, and sets the WAN protocol message such as the PPPoE, the username, and the password.
The DHCP setting module 400 sets the DHCP predefined information according to the easy-mode enable message. In the exemplary embodiment, the DHCP setting module 400 receives the easy-mode enable message from the web server 200, reads and sets the DHCP predefined information according to the easy-mode enable message, including steps of setting the LAN IP address, enabling the DHCP server, and setting the DHCP server start/end addresses, and setting the DHCP lease time.
The NAT setting module 500 sets the NAT predefined information according to the easy-mode enable message. In the exemplary embodiment, the NAT setting module 500 receives the easy-mode enable message from the web server 200, reads and sets the NAT predefined information according to the easy-mode enable message, including steps of enabling the NAT and setting the forwarding rule table 610. Finally, the setting results of the WAN setting module 300, the DHCP setting module 400, and the NAT setting module 500 are executed to complete the NAT configuration of the network apparatus 10.
The system configuration module 700 stores and executes the setting results of the WAN setting module 300, the DHCP setting module 400, and the NAT setting module 500 to complete the NAT configuration. In the exemplary embodiment, after the settings of the WAN setting module 300, the DHCP setting module 400, and the NAT setting module 500 are completed, the network apparatus 10 will be rebooted to execute the setting results, thereby completing the NAT configuration of the network apparatus 10.
In step S300, the web server 200 receives a WAN protocol message and an easy-mode enable message via the user interface 100.
In step S302, the WAN setting module 300 sets the WAN protocol message, including information such as a PPPoE, a username, and a password.
In step S304, the DHCP setting module 400 sets DHCP predefined information according to the easy-mode enable message.
In step S306, the NAT setting module 500 sets NAT predefined information according to the easy-mode enable message.
In step S308, the system configuration module 700 executes all settings to complete the NAT configuration.
In step S400, the web server 200 receives a WAN protocol message and an easy-mode enable message from the user interface 100. In the exemplary embodiment, the WAN protocol message includes PPPoE information, a username, and a password.
In step S402, the web server 200 transmits the WAN protocol message and the easy-mode enable message. In the exemplary embodiment, the web server 200 transmits the WAN protocol message to the WAN setting module 300, and transmits the easy-mode enable message to the DHCP setting module 400 and the NAT setting module 500.
In step S404, the WAN setting module 300 receives the WAN protocol message from the web server 200, and sets the WAN protocol message. That is, the WAN setting module 300 sets the PPPoE, the username, and the password.
In step S406, the DHCP setting module 400 receives the easy-mode enable message from the web server 200.
In step S408, the DHCP setting module 400 reads and sets DHCP predefined information. In the exemplary embodiment, the DHCP setting module 400 reads the DHCP predefined information according to the easy-mode enable message, and then sets the predefined information, namely setting an LAN IP address, enabling a DHCP server, setting DHCP server start/end addresses, and setting a DHCP lease time.
In step S410, the NAT setting module 500 receives the easy-mode enable message from the web server 200.
In step S412, the NAT setting module 500 reads and sets NAT predefined information. In the exemplary embodiment, the NAT setting module 500 reads the NAT predefined information according to the easy-mode enable message, and then sets the NAT predefined information, namely enabling an NAT and setting the forwarding rule table 610.
In step S414, the system configuration module 700 executes all settings to complete the NAT configuration.
After the NAT configuration of the network apparatus 10, the network apparatus 10 will be rebooted to execute the setting results, thereby acquiring the network service.
Thus, the network apparatus 10 can receive an easy-mode enable message via the input device 110 of the user interface 100, and transmits the easy-mode enable message to the web server 200, thereby easily configuring an NAT.
Number | Date | Country | Kind |
---|---|---|---|
95115372 | Apr 2006 | TW | national |