SOHO : Small Office Home Office
Freeware - Opensource software tips, tricks, tweaks & fixes for managing, securing, improving the performance of SOHO Desktop, Laptop, Networks
Showing posts with label Networking. Show all posts
Showing posts with label Networking. Show all posts

Wednesday, February 8, 2012

Find IP range of any ISP with APNIC


  1. Go here http://wq.apnic.net/apnic-bin/whois.pl
  2. Look up one of the IPs you know of in the range
  3. Look for: mnt-lower
  4. Change the Inverse attributes to mnt-lower
  5. Then do a look up for: MAINT-AU-TIAR-AP (example)
  6. Now click search and all the ranges will come up.


Continue Reading...

Monday, April 18, 2011

How to setup Google DNS on Windows 7 and Windows XP

What is a DNS server?
DNS stuff can get pretty complicated, and I don’t want to go into details, so I’ll just give you a general idea. A DNS server is like a phone book. If you want to call someone using your phone, you may need to look up their phone number. Every website on the net has a 12 digit number (IP Address) that your PC needs to know in order to contact it. When you type a website name into a browser, your PC queries it’s assigned DNS server (the phone book), the DNS server reports the IP address (the phone number) back to your PC, and the PC initiates a connection with the site you requested. This all happens automatically and you really don’t need to know about DNS to use it. Most people are using a private DNS server that’s assigned by their Internet Service Provider, however, there are many open (public) DNS servers out there that anyone can use. Google’s new DNS server is only one among thousands.

Why would you want to use Google’s Public DNS?
Google DNS service is faster, more secure and fairly private. Personally, I prefer OpenDNS, but that’s a topic for another time.

And now – on to the “How to” portion to setup google public DNS in xp and Win 7

Set up Google Public DNS on Windows XP
1. Print this out if you are concerned that you won’t remember the details. You could lose your internet connection if something doesn’t go well. You can reverse any changes you make here by following these steps.

2. Open up the Control Panel and click “Network and Internet Connections”.



2. Then click “Network Connections”.



4. Select your active internet connection and right click on it.



5. Select the TCP/IP service in the list and then click on the Properties button.


6. Look for the DNS section. If there are already numbers listed in there, be sure to write them down so that you can put things back the way they were if Google’s DNS doesn’t work out for you. If the “obtain automatically” button is filled, select the “use the following” button. Then enter in these two numbers – ( 8.8.8.8 and 8.8.4.4 ) – into the DNS section as shown. Click OK to finish up.


7. Open command prompt and run command "ipconfig/flushDNS" as shown in screenshot


8. Clear your browsers cache


9. Open up your web browser and surf around awhile. If you aren’t getting anywhere, try a reboot.

Set up Google Public DNS on Windows 7
1. Print this out if you are concerned that you won’t remember the details. You could lose your internet connection if something doesn’t go well. You can reverse any changes you make here by following these steps.

2. Open up the Control Panel, then select “Network and Internet”.




3. Select “Network and Sharing Center”.



4. Select “Change adapter settings”.



5. Right click on your current internet connection and choose “Properties”.



6. Select the “TCP/IPv4” service in the list, then click the “Properties” button.



7. Look for the DNS section. If there are already numbers listed in there, be sure to write them down so that you can put things back the way they were if Google’s DNS doesn’t work out for you. If the “obtain automatically” button is filled, select the “use the following” button. Then enter in these two numbers – ( 8.8.8.8 and 8.8.4.4 ) – into the DNS section as shown. Click OK to finish up.

8. Open command prompt and run command "ipconfig/flushDNS" as shown in screenshot


9. Clear your browsers cache


10. Open up your web browser and surf around awhile. If you aren’t getting anywhere, try a reboot.
Continue Reading...

Changing DNS settings in one click with DNS jumper v1.0.4

If you don’t know what a DNS is, or how to access your DNS settings, I recommend that you read an article : How to setup Google DNS on Windows 7 and Windows XP


If you already know what DNS is, then you might get a real kick out of DNS Jumper.

DNS Jumper is a freeware, portable and small application that aids the user by providing a one-click system to change DNS servers. The application displays a list of DNS servers that can be activated with the click of the mouse button. Available DNS server range from Google DNS over Open DNS to Ultra DNS, Level 3, Open NIC to the default DNS server of the system.


Here’s what it looks like:



New version of dns jumper is stable , flexible , and has more function , the most important is ; dns jumper is no longer beta (v1.0.4 is first stable release) , v1.0.4 has no problem with x64 architecture

What’s new: 
1. [ Fixed ] – Antivirus “False Positive” Problems (No UPX and No more False Positive)
2. [ Fixed ] – Doesn’t work on some Vista / windows 7
3. [ Fixed ] – Doesn’t work on some x64 systems
4. [ Fixed ] – Doesn’t work on PE (Preinstalled) Environment
5. [ Fixed ] – Doesn’t recognise some Wlan Cards
6. Update function added (Press i - info button and then press Update check button)

7. Backup and restore added (if Dns jumper v1.0.4 First time run, Automatically back up your dns settings) , if you want to restore your settings select Restore (under choose a free DNS Service) and Press apply button

8. Languages preinstalled
9. fastest DNS – a bit improved
10. More Dns (17 to 32) 15 new
11. No problem with USB modems (till now)
12. cmd suport added such as


13. if dns jumper doesn’t recognise your Network card (very rare) can still change dns server settings (choose all Network Cards and press Apply dns button)
14. German Language added
15. a few minor visual changes
- you can add your own language (just edit DnsJumper.ini )
- You can add or delete your own Dns server
- You can cusotmize Dns manually
- You can clear/ flush Dns cache with one click
- Program tests dns ip`s and measure the reaction time
- Fastest dns button test dns reaction times and write the Best one
CRC32: 4703E887
MD5: 35E94061CA67104D2B01EFF076384384
SHA-1: 50F16FEED61CB948360BC81974DE57579023FB81

After downloading, unpack the file and check the MD5 Hash of the file. I recommend you to read this article on How to check and compare MD5 sum of files to verify them


Changing DNS servers is therefor a breeze with DNS Jumper

Source and credit : http://www.sordum.com/?p=4573
Continue Reading...

Thursday, March 10, 2011

How to update Dynamic IP changes to multiples services on DD-WRT opensource router?

The goal of this article to is update dynamic IP with multiple service providers from network router.

Multiple Service Providers :
  • OpenDNS : We are using OpenDNS Basic on our network. It offers web content filtering, proxy / anonymizer blocking, whitelist / blacklist,  phishing protection, botnet protection, Two weeks detailed stat, typo correction, shortcuts and web based administration for free. In short - simple, safer and faster internet experience. 
  • DynDNS : DynDNS service allows you to point a hostname (like myname.dyndns.org) to a dynamic IP address, so that when you type in myname.dyndns.org, it will always resolve to your IP address regardless of whether it changes.

Router : Netgear WNR-3500L flashed with dd-wrt (v24-sp2)
DD-WRT is a Linux based alternative OpenSource firmware suitable for a great variety
of WLAN routers and embedded systems. The main emphasis lies on providing the easiest possible handling while at the same time supporting a great number of functionalities within the framework of the respective hardware platform used. More articles on this to follow. 
DD-WRT uses inadyn client to update DDNS (Dynamic DNS) with any one service provider. But in our case we need to update multiple service providers simultaneously. To achieve this we make use of a third party service called DNS-O-Matic.

  • DNS-O-Matic is a free service from OpenDNS and easy way to announce your dynamic IP changes to multiple services with a single update. Using DNS-O-Matic allows you to pick and choose what Dynamic DNS services you want to notify, all from one easy to use interface.
DD-WRT uses inadyn so the settings are:

DDNS Service: Custom
DYNDNS Server: updates.dnsomatic.com
Username: your username
Password: your password
Hostname: all.dnsomatic.com
URL: /nic/update?



Note on  DNS-O-Matic
  1. Supports 29 service providers . More : https://www.dnsomatic.com/wiki/supportedservices
  2. API tool for developers
  3. Client software for Windows, MAC and Linux : https://www.dnsomatic.com/wiki/software 
  4. Works with hardware supporting TOMATO and DD-WRT firmware.
Continue Reading...

Sunday, August 8, 2010

How to enable IP forwarding in linux?

How to enable IP Forwarding in Linux

By default any modern Linux distributions will have IP Forwarding disabled. This is normally a good idea, as most peoples will not need IP Forwarding, but if we are setting up a Linux router/gateway or maybe a VPN server (pptp or ipsec) or just a plain dial-in server then we will need to enable forwarding. This can be done in several ways that I will present bellow.

Check if IP Forwarding is enabled

We have to query the sysctl kernel value net.ipv4.ip_forward to see if forwarding is enabled or not:
Using sysctl:




sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 0

or just checking out the value in the /proc system:




cat /proc/sys/net/ipv4/ip_forward
0

As we can see in both the above examples this was disabled (as show by the value 0).

Enable IP Forwarding on the fly

As with any sysctl kernel parameters we can change the value of net.ipv4.ip_forward on the fly (without rebooting the system):




sysctl -w net.ipv4.ip_forward=1

or




echo 1 > /proc/sys/net/ipv4/ip_forward

the setting is changed instantly; the result will not be preserved after rebooting the system.

Permanent setting using /etc/sysctl.conf

If we want to make this configuration permanent the best way to do it is using the file/etc/sysctl.conf where we can add a line containing net.ipv4.ip_forward = 1




/etc/sysctl.conf:
net.ipv4.ip_forward = 1

if you already have an entry net.ipv4.ip_forward with the value 0 you can change that 1.
To enable the changes made in sysctl.conf you will need to run the command:




sysctl -p /etc/sysctl.conf

On RedHat based systems this is also enabled when restarting the network service:




service network restart

and on Debian/Ubuntu systems this can be also done restarting the procps service:




/etc/init.d/procps.sh restart

Using distribution specific init scripts

Although the methods presented above should work just fine and you would not need any other method of doing this, I just wanted to note that there are also other methods to enable IP Forwarding specific to some Linux distributions.
For example Debian based distributions might use the setting:




/etc/network/options:
ip_forward=no

set it to yes and restart the network service.
Also RedHat distributions might set this using:




/etc/sysconfig/network:
FORWARD_IPV4=true

and again restart the network service.
Regardless the method you have used once you have completed this you can check it out using the same method shown above:




sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1




cat /proc/sys/net/ipv4/ip_forward
1

If the result is 1 then the Linux system will start forwarding IP packets even if they are not destined to any of its own network interfaces.
ps. I was setting up a VPN  server when I wrote this post.
Continue Reading...

OpenVpn server.conf sample file


#################################################
# Sample OpenVPN 2.0 config file for            #
# multi-client server.                          #
#                                               #
# This file is for the server side              #
# of a many-clients <-> one-server              #
# OpenVPN configuration.                        #
#                                               #
# OpenVPN also supports                         #
# single-machine <-> single-machine             #
# configurations (See the Examples page         #
# on the web site for more info).               #
#                                               #
# This config should work on Windows            #
# or Linux/BSD systems.  Remember on            #
# Windows to quote pathnames and use            #
# double backslashes, e.g.:                     #
# "C:\\Program Files\\OpenVPN\\config\\foo.key" #
#                                               #
# Comments are preceded with '#' or ';'         #
#################################################

# Which local IP address should OpenVPN
# listen on? (optional)
;local a.b.c.d

# Which TCP/UDP port should OpenVPN listen on?
# If you want to run multiple OpenVPN instances
# on the same machine, use a different port
# number for each one.  You will need to
# open up this port on your firewall.
port 1194

# TCP or UDP server?
;proto tcp
proto udp

# "dev tun" will create a routed IP tunnel,
# "dev tap" will create an ethernet tunnel.
# Use "dev tap0" if you are ethernet bridging
# and have precreated a tap0 virtual interface
# and bridged it with your ethernet interface.
# If you want to control access policies
# over the VPN, you must create firewall
# rules for the the TUN/TAP interface.
# On non-Windows systems, you can give
# an explicit unit number, such as tun0.
# On Windows, use "dev-node" for this.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun

# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel if you
# have more than one.  On XP SP2 or higher,
# you may need to selectively disable the
# Windows firewall for the TAP adapter.
# Non-Windows systems usually don't need this.
;dev-node MyTap

# SSL/TLS root certificate (ca), certificate
# (cert), and private key (key).  Each client
# and the server must have their own cert and
# key file.  The server and all clients will
# use the same ca file.
#
# See the "easy-rsa" directory for a series
# of scripts for generating RSA certificates
# and private keys.  Remember to use
# a unique Common Name for the server
# and each of the client certificates.
#
# Any X509 key management system can be used.
# OpenVPN can also use a PKCS #12 formatted key file
# (see "pkcs12" directive in man page).
ca ca.crt
cert server.crt
key server.key  # This file should be kept secret

# Diffie hellman parameters.
# Generate your own with:
#   openssl dhparam -out dh1024.pem 1024
# Substitute 2048 for 1024 if you are using
# 2048 bit keys. 
dh dh1024.pem

# Configure server mode and supply a VPN subnet
# for OpenVPN to draw client addresses from.
# The server will take 10.8.0.1 for itself,
# the rest will be made available to clients.
# Each client will be able to reach the server
# on 10.8.0.1. Comment this line out if you are
# ethernet bridging. See the man page for more info.
server 10.8.0.0 255.255.255.0

# Maintain a record of client <-> virtual IP address
# associations in this file.  If OpenVPN goes down or
# is restarted, reconnecting clients can be assigned
# the same virtual IP address from the pool that was
# previously assigned.
ifconfig-pool-persist ipp.txt

# Configure server mode for ethernet bridging.
# You must first use your OS's bridging capability
# to bridge the TAP interface with the ethernet
# NIC interface.  Then you must manually set the
# IP/netmask on the bridge interface, here we
# assume 10.8.0.4/255.255.255.0.  Finally we
# must set aside an IP range in this subnet
# (start=10.8.0.50 end=10.8.0.100) to allocate
# to connecting clients.  Leave this line commented
# out unless you are ethernet bridging.
;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100

# Push routes to the client to allow it
# to reach other private subnets behind
# the server.  Remember that these
# private subnets will also need
# to know to route the OpenVPN client
# address pool (10.8.0.0/255.255.255.0)
# back to the OpenVPN server.
;push "route 192.168.10.0 255.255.255.0"
;push "route 192.168.20.0 255.255.255.0"

# To assign specific IP addresses to specific
# clients or if a connecting client has a private
# subnet behind it that should also have VPN access,
# use the subdirectory "ccd" for client-specific
# configuration files (see man page for more info).

# EXAMPLE: Suppose the client
# having the certificate common name "Thelonious"
# also has a small subnet behind his connecting
# machine, such as 192.168.40.128/255.255.255.248.
# First, uncomment out these lines:
;client-config-dir ccd
;route 192.168.40.128 255.255.255.248
# Then create a file ccd/Thelonious with this line:
#   iroute 192.168.40.128 255.255.255.248
# This will allow Thelonious' private subnet to
# access the VPN.  This example will only work
# if you are routing, not bridging, i.e. you are
# using "dev tun" and "server" directives.

# EXAMPLE: Suppose you want to give
# Thelonious a fixed VPN IP address of 10.9.0.1.
# First uncomment out these lines:
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252
# Then add this line to ccd/Thelonious:
#   ifconfig-push 10.9.0.1 10.9.0.2

# Suppose that you want to enable different
# firewall access policies for different groups
# of clients.  There are two methods:
# (1) Run multiple OpenVPN daemons, one for each
#     group, and firewall the TUN/TAP interface
#     for each group/daemon appropriately.
# (2) (Advanced) Create a script to dynamically
#     modify the firewall in response to access
#     from different clients.  See man
#     page for more info on learn-address script.
;learn-address ./script

# If enabled, this directive will configure
# all clients to redirect their default
# network gateway through the VPN, causing
# all IP traffic such as web browsing and
# and DNS lookups to go through the VPN
# (The OpenVPN server machine may need to NAT
# the TUN/TAP interface to the internet in
# order for this to work properly).
# CAVEAT: May break client's network config if
# client's local DHCP server packets get routed
# through the tunnel.  Solution: make sure
# client's local DHCP server is reachable via
# a more specific route than the default route
# of 0.0.0.0/0.0.0.0.
;push "redirect-gateway"

# Certain Windows-specific network settings
# can be pushed to clients, such as DNS
# or WINS server addresses.  CAVEAT:
# http://openvpn.net/faq.html#dhcpcaveats
;push "dhcp-option DNS 10.8.0.1"
;push "dhcp-option WINS 10.8.0.1"

# Uncomment this directive to allow different
# clients to be able to "see" each other.
# By default, clients will only see the server.
# To force clients to only see the server, you
# will also need to appropriately firewall the
# server's TUN/TAP interface.
;client-to-client

# Uncomment this directive if multiple clients
# might connect with the same certificate/key
# files or common names.  This is recommended
# only for testing purposes.  For production use,
# each client should have its own certificate/key
# pair.
#
# IF YOU HAVE NOT GENERATED INDIVIDUAL
# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
# EACH HAVING ITS OWN UNIQUE "COMMON NAME",
# UNCOMMENT THIS LINE OUT.
;duplicate-cn

# The keepalive directive causes ping-like
# messages to be sent back and forth over
# the link so that each side knows when
# the other side has gone down.
# Ping every 10 seconds, assume that remote
# peer is down if no ping received during
# a 120 second time period.
keepalive 10 120

# For extra security beyond that provided
# by SSL/TLS, create an "HMAC firewall"
# to help block DoS attacks and UDP port flooding.
#
# Generate with:
#   openvpn --genkey --secret ta.key
#
# The server and each client must have
# a copy of this key.
# The second parameter should be '0'
# on the server and '1' on the clients.
;tls-auth ta.key 0 # This file is secret

# Select a cryptographic cipher.
# This config item must be copied to
# the client config file as well.
;cipher BF-CBC        # Blowfish (default)
;cipher AES-128-CBC   # AES
;cipher DES-EDE3-CBC  # Triple-DES

# Enable compression on the VPN link.
# If you enable it here, you must also
# enable it in the client config file.
comp-lzo

# The maximum number of concurrently connected
# clients we want to allow.
;max-clients 100

# It's a good idea to reduce the OpenVPN
# daemon's privileges after initialization.
#
# You can uncomment this out on
# non-Windows systems.
;user nobody
;group nobody

# The persist options will try to avoid
# accessing certain resources on restart
# that may no longer be accessible because
# of the privilege downgrade.
persist-key
persist-tun

# Output a short status file showing
# current connections, truncated
# and rewritten every minute.
status openvpn-status.log

# By default, log messages will go to the syslog (or
# on Windows, if running as a service, they will go to
# the "\Program Files\OpenVPN\log" directory).
# Use log or log-append to override this default.
# "log" will truncate the log file on OpenVPN startup,
# while "log-append" will append to it.  Use one
# or the other (but not both).
;log         openvpn.log
;log-append  openvpn.log

# Set the appropriate level of log
# file verbosity.
#
# 0 is silent, except for fatal errors
# 4 is reasonable for general usage
# 5 and 6 can help to debug connection problems
# 9 is extremely verbose
verb 3

# Silence repeating messages.  At most 20
# sequential messages of the same message
# category will be output to the log.
;mute 20
Continue Reading...

Monday, July 12, 2010

How to avoid ssh time outs?


When ssh times out it will terminate or you will get error message
write failed : broken pipe

There are two solutions. One is to configure the SSH server to send a packet to the client, and the other is to configure your SSH client to send a packet to the server. If you have lots of servers, setting it on the client will be easiest. If you connect to a single server from lots of different locations, then setting it on the server will make more sense. Or, you can configure both to do it.

Configure the server
Open up/etc/ssh/sshd_configand find the ClientAliveInterval option (if it’s not there, add it). The value is in seconds, so I went with 180 seconds, or  3 minutes.
ClientAliveInterval 180

Configure the client

Edit  /etc/ssh/ssh_config
and find the ServerAliveInterval option (if it’s not there, add it). Again, this value is in seconds, so a 9-minute interval is 180 seconds.
ServerAliveInterval 180

The default of both of these values is 0, which means no alive packets are sent. Setting them to anything other than 0 makes the SSH server or client send a packet across the encrypted SSH channel every ‘n’ seconds, thus avoid the idle timeout on the router. It has finally resolved my timeout issues, for which I’m very grateful.
Continue Reading...

Sunday, July 11, 2010

Linux dynamic IP updater "DDClient"

DDclient is an open-source dynamic IP update client written in Perl. ddclient is available here: http://ddclient.wiki.sourceforge.net/
Below is the ddclient.conf template for opendns and dyndns services.
To use ddclient with OpenDNS, please use the following configuration.
##
## OpenDNS.com account-configuration
##
use=web, web=whatismyip.org
server=updates.opendns.com
protocol=dyndns2      
login=opendns_username
password=opendns_password
opendns_network_label

Make sure SSL is enabled at the top of the configuration (ssl=yes # use ssl-support.)

To use ddclient with DynDNS, please use the following configuration.
##
## DynDNS.com account-configuration
##
use=web, web=checkip.dyndns,org, web-skip='IP Address'
server=members.dyndns.org 
protocol=dyndns2      
login=dyndns_username
password=dyndns_password
Dyndns_HostName

Make sure SSL is enabled at the top of the configuration (ssl=yes # use ssl-support.)

My ddclient.conf
# Configuration file for ddclient generated by debconf
## /etc/ddclient.conf

## use ssl support
ssl=yes

##
## DynDns.com account configuration
##
protocol=dyndns2
use=web, web=checkip.dyndns.com, web-skip='IP Address'
server=members.dyndns.org
login=xxxxxx
password='123456abcd'
xxxxxx.xxxxxx.net

##
##opendns.com account configuration
##
protocol=dyndns2
server=updates.opendns.com
use=web, web=whatismyip.org
login=xxxxxxxx_xxxxx
password='123456abcd'
ipcop
Continue Reading...