As in many situations the network administrator has task of connecting to remote systems to perform his duties. Ocassionally, the remote tasks become more difficult and frustrating when there are no remote tools available on the system and the remote desktop application is deactivated. Forturnately, Microsoft has provided a means for resolving such problems and therefore restoring back the hope of the administrator.

PsExec is one of the many PsTools Microsoft has provided for network administrors for the sole purpose of system administration. The following steps will show you how to activate RDP remotely from your local computer with the use of PsExec.

1.) Download the official PsTools either from microsoft directly or here

2.) Extract the downloaded file

3.) Just copy PsExec.exe from the extracted location into your executable path ”C:\Windows\System32″.

4.) Open the prompt command line (start -> Run and type “cmd” + OK) and enter the following:

psexec -u {username} -p {password} \\{iP-Address} reg add “hklm\system\currentcontrolset\control\terminal server” /f /v fDenyTSConnections /t REG_DWORD /d 0

whereby:

{username} = Administrator (must be administrator)

{password} = Administrator’s password

{IP-Address} = System IP Address

psexec remote desktop activation

If not already enabled, use the following commands to enable RDP traffic through the windows firewall:

psexec \\ {iP-Address} netsh firewall set service remoteadmin enable

psexec \\ {iP-Address} netsh firewall set service remotedesktop enable

Note:

To deactivate RDP, just change “0″ to “1″.

Typing “psexec” displays its usage syntax.

Usage: psexec [\\computer[,computer2[,...] | @file][-u user [-p psswd]][-n s][-l][-s|-e][-x][-i [session]][-c [-f|-v]][-w directory][-d][-<priority>][-a n,n,... ] cmd [arguments]

computer Direct PsExec to run the application on the computer or computers specified. If you omit the computer name PsExec runs the application on the local system and if you enter a computer name of “\\*” PsExec runs the applications on all computers in the current domain.

@file Directs PsExec to run the command on each computer listed in the text file specified.

-a Separate processors on which the application can run with commas where 1 is the lowest numbered CPU. For example, to run the application on CPU 2 and CPU 4, enter: “-a 2,4″

-c Copy the specified program to the remote system for execution. If you omit this option then the application must be in the system’s path on the remote system.

-d Don’t wait for application to terminate. Only use this option for non-interactive applications.

-e Does not load the specified account’s profile.

-f Copy the specified program to the remote system even if the file already exists on the remote system.

-i Run the program so that it interacts with the desktop of the specified session on the remote system. If no session is specified the process runs in the console session.

-l Run process as limited user (strips the Administrators group and allows only privileges assigned to the Users group). On Windows Vista the process runs with Low Integrity.

-n Specifies timeout in seconds connecting to remote computers.

-p Specifies optional password for user name. If you omit this you will be prompted to enter a hidden password.

-s Run remote process in the System account.

-u Specifies optional user name for login to remote computer.

-v Copy the specified file only if it has a higher version number or is newer on than the one on the remote system.

-w Set the working directory of the process (relative to the remote computer).

-x Display the UI on the Winlogon desktop (local system only).

-priority Specifies -low, -belownormal, -abovenormal, -high or -realtime to run the process at a different priority. Use -background to run at low memory and I/O priority on Vista.

Enjoy!

Most linux distribution uses the zero configuration network ( ZEROCONF) suite to automatically configure themselves and communicate on a network without the need of DHCP or DNS servers. ZEROCONF is an IETF organ that planned and coordinated a series of dynamic protocols to allow many operating systems to automatically configure themselves.

 

ZEROCONF commonly referred to as IPv4 Link-Local (IPv4LL) and Automatic Private IP Addressing (APIPA) utilises the 169.254.0.0/16 network address to auto-configure a network interface. It uses a series of unanswered “ARP” queries and then assumes an address if the queries yield an empty result. As a result, a route to the ZEROCONF network is added to the routing table by the network initscripts. Example:

The ZEROCONF route

ZEROCONF can be disabled by adding the following entry to the “/etc/sysconfig/network” configuration file.

 

[bash] # vi /etc/sysconfig/network
NOZEROCONF=yes or no (either answer will disable the “ZEROCONF route”)

It is important to note that the value of the “NOZEROCONF” parameter can actually be set to any value. The initscripts can only check to determine whether the parameter has a zero length or not. In other words, setting “NOZEROCONF=no” will have the same effect as setting it to “yes”. In order to reactivate ZEROCONF, the above entry “NOZEROCONF=yes/no” will have to either be commented out or removed entirely.

The network service must be restarted for the changes above to take effect.

[bash] # vi /etc/init.d/network restart

To see if the ZEROCONF route has been disabled, we have to check the routing table again.

The IP routing table

If you ever wonder and want to know more about the the makeup and history of the ZEROCONF, check this very informative zeroconf article written by John C. Welch and this zeroconf article on wikipadia.

Written on January 10th, 2012 , Linux, Networking, Recent Posts

First and foremost, it has to be stated that I am not the author of the original article on this topic. The original article can be found here.

Now, why repeat the same thing here?

Well, on June 10th, 2009, I wrote a reply on this post while in search of a solution for exactly the same purpose as RickNY (The original Author). Back then, I was able to setup my OpenVPN with the help found on various forums. For some reason, I had to change my configurations… which required a different setup. Stupid enough, I made no backup or maybe I did but couldn’t find one, when I needed exactly the same configuration again.

Knowing fully well that I was part of such a discussion before somewhere, I had to google for sometime before I was able to find the the above address again. This time I knew I had to write a backup on my blog.

If you’re seeing this for the first time, just go ahead and try it. I hope it solves your problem. If you’ve seen this somewhere before, please forgive me for the repetition ;-)

Enough of the explanation…!

Why two instances of OpenVPN?

First of all, I have a full-time and part-time Job as a system engineer. In both of my offices, I always have to go through proxies to browse the internet.

Secondly, I have a small private business that requires my attention as well. To achieve this goals, I need to be able to channel my private activities securely through the proxies no matter the protocol been used.

The best solution would be to run double instances of OpenVPN on my private office gateway.

Requirements:
———————

1.) A compatible router running DD-WRT v24-sp2 (I have WRT54GL v1.1)

2.)
LAN Network: 192.168.1.0
VPN Network: 10.32.71.0 (TCP) & 10.71.71.0 (UDP)
Setup keys, etc…

***) Lots of Coffee, Beer, Cigarettes and whatever might cool your temper when something goes wrong.

STEP 1

In GUI on the router, setup OpenVPN Daemon:
 
port 443
proto tcp-server
dev tun0
cipher AES-256-CBC
comp-lzo
dh /tmp/openvpn/dh.pem
ca /tmp/openvpn/ca.crt
cert /tmp/openvpn/cert.pem
key /tmp/openvpn/key.pem
tls-auth /tmp/openvpn/ta.key 0
server 10.32.71.0 255.255.255.0
client-to-client
keepalive 10 120
push “route 192.168.1.0 255.255.255.0″
push “redirect-gateway”
push “dhcp-option DNS 208.67.222.222″
push “dhcp-option DNS 208.67.220.220″
persist-key
persist-tun
verb 5

STEP 2:

Create the first of two configuration files for the client on your windows PC (I never tried this on any other OS).

Let’s call this file “Client1-tcp.ovpn

remote my.openvpn-server.address.com 443
client
proto tcp-client
dev tun0
comp-lzo
resolv-retry infinite
nobind
float
persist-key
persist-tun
ns-cert-type server
verb 3
cipher AES-256-CBC
ca ca.crt
cert client1.crt
key client1.key
tls-auth ta.key 1
ping 10
ping-restart 60
pull

STEP 3:

To limit debugging to either client1-tcp.ovpn or client2-udp.ovpn, I advice testing the connections with client1-tcp.ovpn before continuing…

If successfull, go ahead and create the second client file. Otherwise debug client1-tcp.ovpn first.

Likewise, we have to name this file “Client2-udp.ovpn

remote my.openvpn-server.address 1194
client

proto udp
dev tun0
comp-lzo
resolv-retry infinite
nobind
float
persist-key
persist-tun
ns-cert-type server
verb 3
cipher AES-256-CBC
ca ca.crt
cert client1.crt
key client1.key
tls-auth ta.key 1
ping 10
ping-restart 60
pull

STEP 4:

Entered the following in the “Startup” command window to create the 2nd instance..

Yo may need to adjust the sleep commands to account for the openvpn directory to be created and populated with my keys from the GUI..:

================== Begin Startup =====================

# Move to writable directory and create scripts
cd /tmp
ln -s /usr/sbin/openvpn /tmp/openvpn-udp

# Config
echo “
proto udp
port 1194
dev tun1
cipher AES-256-CBC
comp-lzo
dh /tmp/openvpn/dh.pem
ca /tmp/openvpn/ca.crt
cert /tmp/openvpn/cert.pem
key /tmp/openvpn/key.pem
tls-auth /tmp/openvpn/ta.key 0
server 10.71.71.0 255.255.255.0
client-to-client
keepalive 10 120
push “route 192.168.1.0 255.255.255.0″
push “redirect-gateway”
push “dhcp-option DNS 208.67.222.222″
push “dhcp-option DNS 208.67.220.220″
persist-key
persist-tun
verb 5
daemon
” > openvpn-udp.conf

# Create interfaces
/tmp/myvpn –mktun –dev tun1

# Initiate the tunnel
sleep 5
/tmp/openvpn-udp –daemon –config openvpn-udp.conf

# TCP OpenVPN Startup
sleep 15
cd /tmp/openvpn/
openvpn –daemon –config openvpn.conf

=================== End Startup ======================

One more step to go…

STEP 5:

Entered the following in the “Firewall” command window to create the iptables for your openvpn-server

================= Start Firewall =================

iptables -I INPUT -p tcp --dport 443 -j ACCEPT
iptables -I INPUT -p udp --dport 1194 -j ACCEPT
iptables -I FORWARD -i br0 -o tun0 -j ACCEPT
iptables -I FORWARD -i tun0 -o br0 -j ACCEPT
iptables -I FORWARD 1 --source 10.32.71.0/24 -j ACCEPT
iptables -I FORWARD 1 --source 10.71.71.0/24 -j ACCEPT

================== End Firewall ==================

That’s it! I hope it helps someone like me…

Hey! no matter the amount of bugs you might get… don’t blame me. Everything in life is risk ;-)
Remeber Tom Jones? The very best in life is always free!!! Enjoy!

 

Written on January 6th, 2011 , DD-WRT, OpenVPN

I use an official Notebook which I often take home when dealing with official projects. The problem is I only have one Network Adaptor or LAN device on this machine. As a result, the network configurations in both locations becomes very tricky. As a network engineer, I know there are other possibilities of solving this problem but I just thought this little batch program might help someone else.

Just copy and past the content between “Start” and “End” on a file using notpad or other editing tools. Save and name the file what you want, run and follow the instructions. Enjoy and share! ;)

:::::::::::::::::::::::::::::::::: Start ::::::::::::::::::::::::::::::::::::::::

@echo off
cls
Echo ————————— Switch IP Address ——————————————————–
Echo (c) 2010 omotech computer services
Echo This Program was written on March 24, 2010 by Stanley O. Omoregie.
Echo It allow the easy switch of IP Address settings between two networks.
Echo The program is copyrighted and can only be used and distributed as it is,
Echo without removing this copyright information.
Echo —————————————————————————————————————–
echo Choose between A und B:
echo [A] Set Static IP Address (Office)
echo [B] Set DHCP (Home)
echo.
echo Choose between A und B:
echo [A] Set Static IP Address (Office)
echo [B] Set DHCP (Home)
:choice
SET /P C=
Echo.
Echo.[A,B]
for %%? in (A) do if /I “%C%”==”%%?” goto A
for %%? in (B) do if /I “%C%”==”%%?” goto B
goto choice
:A
@ECHO off
echo Please enter IP Adresse for choice [A]:
set /P IP_Addr=

echo Default Gateway:
set /P D_Gate=

echo Subnet Mask:
set /P Sub_Mask=

echo Setting static IP Address&
netsh interface ip set address “LAN” static %IP_Addr% %Sub_Mask% %D_Gate% 1
ECHO Here is the setting information for %computername%:
netsh int ip show config
pause
goto end

:B
@ECHO OFF
ECHO DHCP is resetting the IP Address and Subnet Mask.
netsh int ip set address name = “LAN” source = dhcp

ipconfig /renew

ECHO Here is the setting information for %computername%:
netsh int ip show config
pause
goto end

:end
Script END!

:::::::::::::::::::::::::::::::::: End ::::::::::::::::::::::::::::::::::::::::

I made an EXE file from the batch program. You can download this to get both files.



This tutorials shows how the router Linksys WRT54G Version 1.1 (serial number starts with reflashing CL7B) with DD-WRT. Through this process, the capabilities of the router to be expanded. Flashing takes place in two stages: the first section needs to be flashed with the mini version of DD-WRT. The second section is then flashed with the standard version of DD-WRT. Warning: By flashing one can possibly lose warranty claims. Everything at your own risk. Details:


Netzwerkkabel an Port 1 des WRT54GL



The Network cable to port 1 (1) The WRT54GLv1.1 is connected to the power supply, which in turn depends on the socket.


A blue network cable is connected to Port 1. (2) Ports 2, 3, or 4 may be used as well.  However, port 1 has been chosen for this example and worked successfully. The other ports remain free. Better safe than sorry. The flash process should not be disturbed.

Netzwerkkabel am LAN-Anschluss
The network cable (3) is connected to the central unit. The computer is currently not connected to the internet, but only to the WRT54GLv1.1

DD-WRT Download-Sektion
DD-WRT Download-Section
(4) Now, connect to the internet with a second computer and click on the link: DD-WRT Download-Section.
(5) Note that there are several versions of DD-WRT.
(6) The current version is 23 SP1. Click on the version dd-wrt.v23 SP1.

DD-WRT Version 23 SP1
DD-WRT version 23 SP1
(7) This takes you to where other categories of version SP1 is been offered.
(8) This is a micro-version. This is for example made for the lousy WRT54G version 5. The WRT54G version 5 has only  2 MB flash memory. In the previous versions, there were more memory.
(9) Fortunately, WRT54GLv1.1 has 4 MB flash memory. For this reason, we can choose for the router modell the mini-version.
(10) The standard version is suitable for professional use.
(11) There is also a version for VoIP. It would be very interesting to know whether this version adds significant value to the standard version, if you want to use Internet telephony.
(12) And then there’s a version with OpenVPN.

DD-WRT Version 23 SP1 (Mini) downloaden
DD-WRT version 23 SP1 (mini) (13): We have to decide in this case for the mini version.
(14) A dialog box opens to download the mini-version of DD-WRT version 23 SP1.
(15) It doesn’t matter whether you “choose Open with CompressedFolder” or “on floppy / hard disk space”.
(16) Click OK.

Dateien sind heruntergeladen
Files are downloaded (17) For a brief moment will later be shown that all files have been downloaded

dd-wrt.v23_sp1_mini.zip extrahieren
dd-wrt.v23_sp1_mini.zip extract (18) on your own computer is now the packed file “dd-wrt.v23_sp1_mini.zip.” By clicking the right mouse button on the file.
(19) Select 7-Zip.
(20) Select »Extract here«

dd-wrt.v23_mini_generic.bin
dd-wrt.v23_mini_generic.bin
(21): Take a look at the extracted files. There are several router models for special specifications of the mini-version. If you want to flash a different router than the model discussed here, then you should better look on the Internet for other instructions. In the present case (WRT54GLv1.1), will be flashed with dd “-wrt.v23_mini_generic.bin”.

Auf Reset-Knopf des Linksys WRT54GLv1.1 drücken
eset the router by pressing with a pen
(22) the reset button for 30 Seconds.

IP-Adresse des Routers eingeben
Type the password »admin«
(23) and start the internet browser.
(24) In the address bar you type the IP address of the router. This is 192.168.1.1.
(25) Now you will be prompted to enter username and password.
(26) The field with the username can be left empty.
(27) The Password is »admin«.
(28) Click OK.

Administration des WRT54GLv1.1
WRT54GLv1.1
(29) Administration: You’ll be taken to WRT54GLv1.1 administration portal. You can see the standard software from Linksys / Cisco.

Auf Firmware Upgrade klicken
Click on Firmware Upgrade. One can see that the firmware version is 4.30.7. This is wiil soon be replaced with DD-WRT.

(30) Click on the “Administration” tab.
(31) Click on Firmware Upgrade.

dd-wrt.v23_mini_generic.bin
dd-wrt.v23_mini_generic.bin Select (32) Click “Browse …”.
(33) The window “file upload” window opens.
(34) One would like the mini version of DD-WRT Version 23 SP1 upload.
(35) In this case you need to choose the generic version.

Pfad zur generic-Version

Upgrade to Internet Explorer

(36) This field is now the path to the generic version, with the WRT54GLv1.1 will be flashed immediately.
(37) Nearly one would now clicked upgrade. But wait! Stop! Still do not click! You have read on the Internet the information that one better to flash using the Internet Explorer and Firefox. Firefox is even, is not optimal. Better to use the Internet Explorer. Therefore leads to the steps (23 to 36) again again. This time not with Firefox, but with the Internet Explorer. Then you click the Internet Explorer upgrade.

Upgrade is successful

Upgrade is successful

(38) In the present case had to wait about 1 minute. Then shows the message »”Upgradeis successful.. “
(39) Click »Continue.

WRT54GL Login
Username is now “root” (39) After you have just clicked on CONTINUE, (40) opens the dialog box where you should enter user name and password to access the IP address 192.168.1.1 can.
(41) This is an indication that this is the WRT54GL.
(42) The user name must be entered now root “. This is different than before in (26) than in the original Linksys firmware was installed. At the time, specify a user name does not need now is required.
(43) The password is still “admin”.
(44) Click OK.

DD-WRT v23 SP1 mini
DD-WRT v23 SP1 mini
(45) in the browser now indicates that DD-WRT v23 SP1 is final (16/05/2006) installed mini. So currently only the mini version is installed. In a further step is flashed on the standard version. Why so complicated? Why first install the mini version first and then the standard version? The reason is that the original Linksys firmware, a firmware upgrade is limited to a maximum of 3 MB. The mini version has less than three megabytes. The standard version has more than three megabytes. If you have installed the mini version, then there is no longer the limit to three megabytes. Then there is only the limit of available flash memory. In this case, the WRT54GLv1.1 is this flash memory (as said) 4 MB. The flash memory is sufficiently large for the standard version.

dd-wrt.v23_sp1_standard.zip
dd-wrt.v23_sp1_standard.zip
(46) Man goes again – as in step (4) – in the DD-WRT downloads section.
(47) One recalls that it had decided to step (13) for the mini version. What was the justification for this again? Oh right, the mini version has less than 3 MB. That is why you chose them.
(48) Now you may opt for the standard version.

DD-WRT Version 23 SP1 Standard

DD-WRT Version 23 SP1 Standard

(48) Once you have decided on the standard version,

(49) A dialog box opens, where you will be asked if you want the standard version of DD-WRT Version 23 SP1 download.
(50) Click OK.

dd-wrt.v23_generic.bin
dd-wrt.v23_generic.bin
(51) It takes a look at the files that you have just downloaded. In the present case, later the generic version is uploaded. It notes that in the file name is no reference to the fact that it is actually not the version 23, but about the Version 23 SP1. This is a bit misleading, but it is in “dd-wrt.v23_generic.bin” despite the inaccurate labeling of Version 23 SP1.
(52) On the screenshot indicates that the packet size is approximately 3.41 MB. So the standard version has more than three megabytes. It can be installed immediately, because the router is already the mini version of DD-WRT. The standard version can not be installed when the router is on the original Linksys firmware.


Click “firmware upgrade” – on “Administration”

(53) In Internet Explorer you are in the address bar the IP address of the router 192.168.1.1.
(54) “Administration” – click “firmware upgrade”.
(55) “Browse …” button.

WRT54GLv1.1 Reset-Knopf drücken
Press the reset button

(56) Now you do for safety – just as in step (22) – a reset. 30 seconds with a ballpoint pen to press the reset button.

dd-wrt.v23_generic.bin auswählen
dd-wrt.v23_generic.bin Select

(55) They had only just clicked on “Browse …”.
(57) A dialog box for selecting the uploaded file is opened.
(58) You want the standard version of DD-WRT Version 23 SP1 upload.
(59) For the WRT54GLv1.1 is the file “dd-wrt.v23_generic.bin” the correct version.

Upgrade mit dd-wrt.v23_generic.bin
Upgrading to dd-wrt.v23_generic.bin

(60) The path to the file “dd-wrt.v23_generic.bin” now specified in this field.
(61) It is the warning message notes. A firmware update can take several minutes. Earlier, the fix lasted about 1 minute. Let’s see how long it will take now.
(62) Click upgrade.

Upgrading to DD-WRT 23 SP1 Standard
Progress bar moves

(63) It now takes about 1 minute, in which the progress bar moves back and forth.


Upgrade was successful

(64) The upgrade was successful. The message “upgrade successful. Unit is rebooting now. Please wait a moment …. “You have to wait many seconds now.

DD-WRT v23 SP1 Final std
Standard version is installed

(65) It is now in the browser. There is “std by the abbreviation” indicates that now the default version installed. Earlier, at (45) was the mini version of the words “mini” was displayed.

Summary: Flashing the WRT54GLv1.1 in two steps: First, flash the mini version. Then flash with the standard version. Flashing should be done with the Internet Explorer.

Items with similar content: WRT54G v4 Installation Tutorial

Written on January 25th, 2010 , DD-WRT, LinkSys, WRT54GLv1.1

OMOTECH Tips & Tricks is proudly powered by WordPress and the Theme Adventure by Eric Schwarz
Entries (RSS) and Comments (RSS).

OMOTECH Tips & Tricks

this blog offers tutorials based on various it-subjects