Configuring ddclient

ddclient updates IP addresses at dynamic DNS services.

# install ddclient
$ sudo apt-get install ddclient

Configuring dyndns.com

Selected dyndns.com in the installation process and followed the prompts. Did not need to manually enter anything.

Configuring namecheap.com

Enable Dynamic DNS for your domain
Login to your Namecheap control panel and enable dynamic DNS for your domain.
You’ll get a really long password string to use. Save that for now as you’ll need it later on.
namecheap dynamic dns password

$ sudo nano /etc/ddclient.conf

# namecheap.com example configuration
# the login is the domain name and password is the hash you saved in the prior step called ‘Dynamic DNS Password’.

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

protocol=namecheap
use=web, web=dynamicdns.park-your-domain.com/getip, web-skip='IP Address'
server=dynamicdns.park-your-domain.com
login=baligena.com
password='36e39d6fief87be5e38c7d7507863'
@,www

# remove cache
$ sudo rm /var/cache/ddclient/ddclient.cache

# force update, you may need to delete cache
$ sudo ddclient --daemon=0 --debug --verbose --noquiet

# another configuration file
$ sudo nano /etc/default/ddclient
# to enable automatic updates you must enable the daemon, see specified settings

run_dhclient="false"
run_ipup="false"
run_daemon="true"
daemon_interval="300"

# restart ddclient
$ sudo /etc/init.d/ddclient restart

source:

tags:
ddns, Dynamic DNS

Connect to wifi in the command line

The wifi access point security will determine the way you connect to it.

If WEP (less secure)
http://askubuntu.com/questions/294257/connect-to-wifi-network-through-ubuntu-terminal#answer-294320

If WPA
http://askubuntu.com/questions/138472/how-do-i-connect-to-a-wpa-wifi-network-using-the-command-line#answer-138476

Configuring WPA
# view enabled connections
$ ifconfig

# view enabled and disabled connections
$ ifconfig -a

# To find out the name of your wireless card device. Look at the row that has some information in it, not ‘no wireless extensions’. In this example its wlan0.
$ iwconfig

# find wireless/wifi access points
$ sudo iwlist scan
# an alternative can be “wavemon” if installed on your machine

# Add wifi network ssid and password
$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
# add to the bottom of file

network={
 ssid="your_wireless_ssid"
 psk="your_wireless_password"
}

# wpa_supplicant.conf is being included in /etc/network/interfaces. Another option would be to edit interfaces file directly. Example Below.

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
auto wlan0

iface wlan0 inet dhcp
	wpa-ssid "your_wireless_ssid"
	wpa-psk "your_wireless_password"

# restart connection. This is an alternative to restarting the computer
$ sudo ifdown wlan0
$ sudo ifup wlan0

# you should now see an ip address under “inet addr:”
$ ifconfig wlan0

# test internet connection
sudo ping google.com

# useful commands
# 10 Useful “IP” Commands to Configure Network Interfaces

$ ip addr show
$ ip route show

tag:
wireless interface, network, raspberry pi

Stop DNS hijacking and setting DNS server

– disable DNS hijacking
– change DNS server
– setting up google as DNS server

What is DNS hijacking ?
– DNS redirecting

Why don’t I want it ?
– When I but a url that is not recognized it gets redirected to ads
– It interferes with avahi-daemon (zeroconf)

How do I know its occurring ?
– by typing a non existing url in the browser
– ping a non existing url
– in windows by running nslookup in the command line and seeing a foreign ip address

How to stop it ?
– setting up a specific router (http://hackercodex.com/guide/how-to-stop-isp-dns-server-hijacking/)
– or changing your computer dns server (https://developers.google.com/speed/public-dns/docs/using)
– use QuickSetDNS

More ?
– in windows command line running ipconfig /all will show what dns server you’re running

In linux
You will need to edit the ‘/etc/resolv.conf’ with the nameserver of your choice. You can manually edit it (without restarting anything) and have it work however it you restart you computer it will be overwritten by resolvconf. To avoid the overwriting you need to edit ‘/etc/resolvconf/resolv.conf.d/head’ instead. Now if you cannot find that file you will need to update ‘resolvconf’ by running ‘$ apt-get install resolvconf’ (had to do it for raspberry pi). source
To force resolvconf to update /etc/resolv.conf run
$ sudo resolvconf -u

Another ‘not a good idea’ option is to use ‘$ chattr +i’ to lock down ‘resolv.conf’ which seems hacky

tags:
time warner
bright house network

Virtual Box Internet Issue

The problem:
unable to connect to internet
$ ping google (doesnt work)

What might cause the problem:
Added the ‘Host-only Adapter’ network to the virtual box

Solution:
remove static ip from /etc/network/interfaces (changed it back to dynamic)

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp

#auto eth0
#iface eth0 inet static
#       address 192.168.0.108
#       netmask 255.255.255.0
#        network 192.168.0.0
#        broadcast 192.168.0.255
#        gateway 192.168.0.1

remove the 2nd network and only stayed with the 1st one (Bridged Adapter)

reflesh the MAC address (not sure if this help)

reboot

edit /etc/network/interfaces changed back to static ip address

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug eth0
#iface eth0 inet dhcp

auto eth0
iface eth0 inet static
        address 192.168.0.108
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.1

OR
edit using the GUI
http://askubuntu.com/questions/338442/how-to-set-static-ip-address#answer-338855

operating system:
Linux cowboy 3.12-kali1-686-pae #1 SMP Debian 3.12.6-2kali1 (2014-01-06) i686 GNU/Linux

Change Linksys WRT54G Default Gateway IP Address

Changing linksys local/default gateway ip address from 192.168.1.1 to 192.168.0.1

1. Connect an Ethernet cord to you router LAN and your computer
2. Login into the router by opening a browser and typing 192.168.1.1
3. Go to Setup-> basic setup
4. change “Local IP Address:” to 192.168.0.1
http://x-v.it/f3eru4

5. Unplug the power to the router and Ethernet cord from the computer and wait 30 seconds
6. Plug everything back and you should now be able to log into router with 192.168.0.1
and if you run ipconfig in the command line you should see the default gateway as 192.168.0.1
http://x-v.it/n9dfjf
also see other parts of the software with same ip address such as http://x-v.it/fna6kj

7. Unplug the Ethernet cord from the computer and see if you can connect to it wireless
8. Plug the router WAN to the modem for internet.
9. You’ll need to configure you linksys router to get internet

Setting Up Linksys Router


10. Done.

The reason I needed this was because I have two routers and they cannot have both the same gateway 192.168.1.1

How to change the motorola router

Motorola SBG6580 Router / Modem

Motorola SBG6580 Router / Modem

My router was recently changed and I tried to bridge it (act only as a modem) but it didn’t work. I had a perfect working Linksys router but my ISP had to changed my old modem to a 2 in 1 piece of shit Motorola SBG6580. The default gateway for the Motorola is different than the Linksys so I had to re-configure my server, which I did however there were some stuff that wasn’t working correctly. I didn’t know how to track it down or how to fix it so instead of going thru that headache I decided to change the Motorola default gateway/LAN IP address to what the Linksys was and it worked.

To change the LAN IP address from 192.168.0.1 to 192.168.1.1
log into you motorola router 192.168.0.1
Navigate to,
Basic-> Setup-> change Lan Ip address to 192.168.1.1
then click apply. you wont be able to connect to wireless internet
so connect to the Ethernet cord and go to
Basic-> Setup-> click “Renew WAN LEASE”

Motorola SBG6580
http://x-v.it/uploads/capit/sa/62/4k.jpg

resource:
http://broadband.custhelp.com/app/answers/detail/a_id/22215

>change IP address on linux

>I was having issues with git connection to my laptop thru ssh. Then after looking into it, my laptop had changed IP address. Now I didnt want to change all the git fetch origin source on all my repositories so here is how to change the IP address back.

# sudo ifconfig [connection] [IP you want]
$ sudo ifconfig eth0 192.168.1.5

sources:
http://www.cyberciti.biz/faq/linux-change-ip-address/

How to set up Static IP address for Server

Its good practice to give your server a static IP address because
1. You don’t always need to reconfigure your router
2. It’s easy to do

Click on the link below for a full explanation

http://www.howtogeek.com/howto/ubuntu/change-ubuntu-server-from-dhcp-to-a-static-ip-address/

Below is an example. Make sure you change the interface and the private ip to match the gateway

auto wlan0
iface wlan0 inet static
        address 192.168.1.3
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1

PS. It’s not true that you need a static IP address for the world to access you website from you server. You can also use a dynamic (DHCP), which is the default when you set up your Ubuntu server.

For more infomation on Making your server accessible to the internet