Provides dial-up shared Internet access through the server system's soft route service + NAT (available version)

Source: Internet
Author: User
Tags dns2

This is the batch processing code that was previously written when I cracked shared Internet access at school. This may be the old version I was looking for. It was a secret recipe and I just found the EXE version to decompile the code, I don't have time to check it. I remember I changed it. I couldn't find the new version. I didn't even get it after graduation. The Code is even less familiar, but it is better than shared guard. And now the Wireless WiFi transmitter is so popular, and those software vendors in Kingsoft have provided the software version to share the Internet. You don't need this old method. However, this method is incomparable, that is, it is far away from WiFi and passthrough through the Intranet. This is the effect of technology implementation. Haha ~~


@ Echo off

Mode con Cols = 84 lines = 22

Title --- simple and powerful Internet sharing setting program --- QQ: 938009139

Color 79


: Menu

CLS

Echo.

Echo creates and configures shared Internet access-created by opq Based on win2003

Echo ------------------------------------------------------------


Echo [1] Press the 1 key to start creating the local Internet sharing service

Echo [2] Press the 2 key to view the current configuration information

Echo [3] Press the 3 key to add a shared access user

Echo [4] Press the 4 key to delete the shared access user

Echo [5] Press the 5 key to disable the Internet sharing service

Echo [6] Press the 6 key to enable 32-bit win7 System Support

Echo [7] Press the 7 key to enable 32-bit Vista system support

Echo [m] Press the M key -------- return menu --------

Echo.

Set choice =

Set/P choice = select the operation to perform:

If/I '% choice :~ 0, 1% '= '1' goto cmdvpn

If/I '% choice :~ 0, 1% '= '2' goto showset

If/I '% choice :~ 0, 1% '= '3' goto adduser

If/I '% choice :~ 0, 1% '= '4' goto deluser

If/I '% choice :~ 0, 1% '= '5' goto stopvpn

If/I '% choice :~ 0, 1% '= '6' goto win7_32

If/I '% choice :~ 0, 1% '= '7' goto Vista

If/I "% choice %" = "M" Goto menu

Exit



: Cmdvpn

@ Echo off

CLS

Echo.

Echo --------- make sure that the program is run as administrator user permissions. Read the following carefully and follow the prompts to operate .---------

Echo.

Set Nic = Local Connection

Set mask = 255.255.255.0

Echo 1. If the name of your network adapter is not [local connection] But [local connection 2] or [wireless network connection,

For Echo, enter the name at the cursor below, for example, local connection 3. Otherwise, press enter to skip it!

Set/P Nic =

Echo success -----------------------------------------------------------------------------------

The current echo sharing settings will be selected with the name: % Nic %! [If an error occurs here, close the program and open it again]

Echo success -----------------------------------------------------------------------------------

Echo.

Echo 2. Please stop (disable) Your "% Nic %" now. Stop (disable) and return to this program. Press any key to continue and fill in as required!

Pause> NUL

Echo.

Set/P localip = enter the IP address currently allocated to your Internet access:

Set/P mask = enter the subnet mask of the IP address you allocated: 255.255.255.0 (default, that is, press ENTER; if not, enter:

Set/P gway = enter the gateway where your assigned IP address is located:

Set/P dns1 = enter your preferred DNS address:

Set/P dns2 = enter the appropriate local DNS address:


Echo ------------------------------------------------------

ECHO is setting the IP address of % Nic %. Please wait...


Echo. IP address = % localip %

Echo. subnet mask = % mask %

Netsh interface IP Set address name = % Nic % source = static ADDR = % localip % mask = % mask %> NUL


Echo. Gateway = % gway %

Netsh interface IP Set address name = % Nic % gateway = % gway % gwmetric = 1> NUL


Echo. preferred DNS = % dns1 %

Netsh interface IP Set DNS name = % Nic % source = static ADDR = % dns1 % register = primary> NUL


Echo. Alternate DNS = % dns2 %

Netsh interface IP add DNS name = % Nic % ADDR = % dns2 % Index = 2> NUL


Set addr2 = 192.168.66.5

Set mask2 = 255.255.255.0

Netsh interface IP add address % Nic % addr2 % mask2 %

CLS

Echo please re-enable the NIC named "% Nic %". After the NIC is started, return to this program. Press any key to continue!


Echo affects the service when the configuration is started or disabled...

SC config sharedaccess start = disabled

Net stop "Windows Firewall/Internet Connection Sharing (ICS )"

Net stop sharedaccess

SC config "Remote Procedure Call (RPC)" Start = auto

Net start "Remote Procedure Call (RPC )"

SC config RemoteRegistry start = auto

Net start "RemoteRegistry"

SC config "RemoteAccess" Start = auto

Net start "RemoteAccess"

SC config "workstation" Start = auto

Net start "workstation"

Net start "Computer Browser"


@ Set errorlevel => NUL

@ CLS

@ Echo -------- enter the user name and press enter to create a dial-up connection user --------:

@ Set/P "vpnusername ="

@ Echo -------- enter the password and press Enter: that is, the password of the dial-up connection user --------:

@ Set/P "vpnuserpass ="

Net user % vpnusername % vpnuserpass %/Add

If errorlevel = 1 CLS & Echo "user may already exist and cannot be created! "& Pause> NUL


ECHO to ensure security, this user cannot be TsInternetUser SUPPORT_388945a0, etc.

Net localgroup users % vpnusername %/del

Echo adds an authorization dial-in policy for the user name to ensure the security of system permissions.

Netsh Ras set user % vpnusername % Permit


Echo sets static address Pool Mode

Netsh Ras IP Set addrassign pool


Echo sets the static pool range. Use a standard LAN address to avoid address forwarding errors when accessing the internet in the future.

Netsh Ras IP add range 192.168.66.6 192.168.66.88


Echo uses address pool allocation

Netsh Ras IP Set addrassign method = pool


ECHO to enable TCP/IP forwarding, you must first install Nat

For/F "Skip = 3 tokens = 3" % I in ('@ Reg query "HKLM \ System \ CurrentControlSet \ Services \ Tcpip \ Parameters"/V ipenablerouter ') do @ if % I NEQ 0x1 (@ Reg Add "HKLM \ System \ CurrentControlSet \ Services \ Tcpip \ Parameters"/V ipenablerouter/T REG_DWORD/D 1/F)


Added Nat protocol support for ECHO

Netsh routing ip nat install


Echo adds Nat in private mode as an excuse [adding Nat in Win2000 is not allowed in Gui]

Netsh routing ip nat add interface name = "internal" mode = private


Echo add Nat interface local connection full forwarding

Netsh routing ip nat add interface name = "% Nic %" full


Inside netsh routing ip igmp Delete Interface


Netsh routing ip igmp install

Netsh routing ip igmp add interface internal igmpprototype = effecifenabled = Enable robustvar = 2 startupquerycount = 2 startupqueryinterval = 31 genqueryinterval = 125 genqueryresptime = 10 lastmemquerycount = 2 bytes = 1000 bytes = Yes


Netsh routing ip igmp add interface name = "% Nic %" igmpprototype = igmpproxy ifenabled = Enable


Echo settings Delete IPSec, RemoteAccess, or warning logs except login information records ..

@ Reg add HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ RasMan \ Parameters/V prohibitipsec/T REG_DWORD/d 00000000/F

@ Reg add HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ RemoteAccess \ Parameters/V loggingflags/T REG_DWORD/d 00000000/F


Echo % Nic %'s IP address is % localip %

Echo adds default route support with the default gateway address % gway %

Route add 0.0.0.0 mask 0.0.0.0% gway %


Echo adds a permanent route table

Route-P add 192.168.66.0 mask limit 255.0% localip %


Echo closes some services to ensure Network Security

Net stop schedule

Net stop Clipbook

Rem net stop Server

CLS

ECHO has established Internet shared access:

Echo ----------------------------------------------------------------------------------

Echo local default gateway address: 192.168.66.5 ext. available IP address range: 192.168.66.6 ~ 88

Echo 1. Open the network connection, right-click the "incoming connection" attribute,

Echo 2. Under "Virtual Private Network", "allow others to use the Internet or other networks to" Tunnel Operations "...", check and confirm!

After the IP address is set for ECHO extension, use dial-up connection: username % vpnusername % password % vpnuserpass %

Echo ----------------------------------------------------------------------------------


Pause> NUL

Goto menu


: Showset

CLS

@ Netsh interface show Interface

@ Netsh Ras IP show config

@ Netsh Ras show use

@ Route print

Pause> NUL

Goto menu


: Adduser

@ Set errorlevel => NUL

@ Echo enter the user name to be created:

@ Set/P "vpnusername ="

@ Echo set a password for the user:

@ Set/P "vpnuserpass ="

Net user % vpnusername % vpnuserpass %/Add

If errorlevel = 1 CLS & Echo msgbox ("the user may already exist and cannot be created! ")

Netsh Ras set user % vpnusername % Permit

Net user % vpnusername % vpnuserpass %

Pause> NUL

Goto menu


: Deluser

@ Set errorlevel => NUL

@ Echo enter the username to delete:

@ Set/P "vpnusername ="

Net user % vpnusername %/del

If errorlevel = 1 CLS & Echo ", the user may have been deleted or has insufficient permissions. The deletion is unsuccessful! "& Pause> NUL

Pause> NUL

Goto menu


: Stopvpn

Route-F

Route delelte 0.0.0.0

Net stop "RemoteAccess"

ARP-d

Echo refresh the local buffer domain name explanation record!

Ipconfig/flushdns

Echo Internet sharing service stopped!

Pause> NUL

Goto menu


: Win7_32

Copy win7_x64 \ ipmontr. dll % SystemRoot % \ system32

Copy win7_x64 \ ippromon. dll % SystemRoot % \ system32

Netsh add helper ipmontr. dll | netsh Delete helper ipmontr. dll & netsh add helper ipmontr. dll

Netsh add helper ippromon. dll | netsh Delete helper ippromon. dll & netsh add helper ippromon. dll

Netsh routing ip nat install add interface name = "% Nic %" mode = full

Netsh routing ip nat install add interface name = "internal" mode = private

Echo.

ECHO has enabled 32-bit win7 to support Internet sharing! Select "1" in the menu to enable it.

Echo 64-bit win7 system may also be supported! (To be tested) can also be used as a fix for win2008r2!

Pause> NUL

Goto menu



: VISTA

Copy vista_x86 \ ipmontr. dll % SystemRoot % \ system32

Copy vista_x86 \ ippromon. dll % SystemRoot % \ system32

Netsh add helper ipmontr. dll | netsh Delete helper ipmontr. dll & netsh add helper ipmontr. dll

Netsh add helper ippromon. dll | netsh Delete helper ippromon. dll & netsh add helper ippromon. dll

Echo.

ECHO has enabled 32-bit vista to support Internet sharing! Select "1" in the menu to enable it.

The echo 64-bit Vista system may also be supported! (To be tested) can also be used as a fix for win2003!

Pause> NUL

Goto menu


Remember to set a small part of the content on the server.

Provides dial-up shared Internet access through the server system's soft route service + NAT (available version)

Related Article

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.