Bang Rajan Learn

To Share Over All The World

How to add Extra Repositories

Posted by petanidigital on January 20, 2008

If you want to add more repositories for more packages, open the terminal and run “sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup” to backup your current sources.list. Then run “sudo gedit /etc/apt/sources.list” to have gedit open sources.list. If you have kubuntu, use kate instead of gedit.

Once open, remove everything and past the following lines in.

## Add comments (##) in front of any line to remove it from being checked.
## Use the following sources.list at your own risk.

deb http://archive.ubuntu.com/ubuntu dapper main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu dapper main restricted universe multiverse

## MAJOR BUG FIX UPDATES produced after the final release
deb http://archive.ubuntu.com/ubuntu dapper-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu dapper-updates main restricted universe multiverse

## UBUNTU SECURITY UPDATES
deb http://security.ubuntu.com/ubuntu dapper-security main restricted universe multiverse
deb-src http://security.ubuntu.com/ubuntu dapper-security main restricted universe multiverse

## BACKPORTS REPOSITORY (Unsupported. May contain illegal packages. Use at own risk.)
deb http://archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse

## PLF REPOSITORY (Unsupported. May contain illegal packages. Use at own risk.)
deb http://packages.freecontrib.org/ubuntu/plf dapper free non-free
deb-src http://packages.freecontrib.org/ubuntu/plf dapper free non-free


Press save and back in the terminal run “sudo apt-get update”.

Posted in Networking, Opetaring System, Ubuntu | Leave a Comment »

Dynamic DNS No-IP

Posted by petanidigital on January 20, 2008

If you have a dynamic IP from your internet service provider it gets annoying when they change your IP and you do not know it, therefore you are not able to connect to your computer remotely anymore. Well Dynamic DNS services fix that problem by assigning a domain to your IP address whenever it changes. This howto will cover getting No-IP, a Dynamic DNS client working.

First if you do not have a No-IP account, create one by going to no-ip.com and registering.

It will send an email to you so you can verify that you want to create account. Click the verification link in your email and it will send you back to the No-IP site.

Log in to the site with the account you just made and click Add under Hosts / Redirects.

Write whatever you want for the subdomain and choose a domain for it to be under. I chose howtonoip for my subdomain and chose to put it under their no-ip.org domain. Scroll down to the bottom and click Create Host.

Now you will need to install the client. Open up your terminal and run “sudo apt-get install no-ip”.

Once installed run “sudo no-ip -C” and select your Internet interface from the list. Then enter your login information. If you added only one host to your no-ip account it will automatically use that. If not it will ask which one(s) to use. Next enter the update interval (in minutes). It will ask you if you want to run something at a successful update. I did not so I selected no.

Your configuration file was just created. Now whenever your IP changes this client software will automatically update the No-IP servers with your new IP. No longer will your ip change and you be locked out of your computer!

Posted in Debian, Linux, Mandriva, Networking, Opetaring System, Red hat, Ubuntu | Leave a Comment »

How to Analyze Network Traffic with ethereal

Posted by petanidigital on January 20, 2008

If you want to see what is coming in and out of your computer or if you have a ubuntu computer as a router and want to analyze data coming in and out of your network there is a very simple way to do it. A program called ethereal can analyze all sorts of connections to and from your computer.

To get it, open the terminal and write (without quotes) “sudo apt-get install ethereal” and answer “Y” to all the questions it asks.

Once installed you will want to run it as root by pressing alt+F2. Type “gksudo ethereal”. It will ask for your password and then once open it will look like this.

To start capturing, press capture and press interfaces. You will be presented with the window shown below. Either press capture on an interface to begin immediate capture or press prepare to set more advanced options.

Once you begin capturing there will be another window that looks like the one shown below. Once you are done capturing, press stop and it will analyze the data.

Once analyzed you will be presented with a screen the looks like the one shown below.

This will contain all the data captured on the selected interface before you pressed stop.

Posted in Debian, Networking, Opetaring System, Ubuntu | Tagged: | Leave a Comment »

Setup Your Computer to be a Router

Posted by petanidigital on January 20, 2008

If you have two network cards or some other means of connecting to the internet and a network card in your ubuntu computer, it can be a very powerfull router. You can set up basic NAT, do port forwarding, set up a proxy, and even do packet prioritization so your downloads dont interfere with gaming! This howto will cover setting up Webmin which will be used to configure masquerading, DHCP, and DNS servers. It also lets you configure port forwarding. QoS (packet prioritization) will be covered in a later guide. This guide is made using kubuntu to show that it will work with any version of ubuntu.

Webmin
Webmin is a web based computer management tool. It is similar to the web interface that you get from routers you buy at stores, but allows you to control most of the computer.
To install webmin, you must first go to its website at www.webmin.com and download the latest version in the top right. Download the tar.gz version into your user folder.

Once the download is complete extract it to a folder for example \usr\webmin. I extracted it into my user folder in this tutorial because this is just a live CD so it doesn’t really matter. You may delete the tar.gz file after you extract it as it is no longer needed.

Before you install it you will want the package “libnet-ssleay-perl”. So open the terminal and run “sudo apt-get install libnet-ssleay-perl”. Now navigate to the directory the folder is (For me it would be “cd /home/ubuntu/webmin-1.280”) and then run the command “sudo sh setup.sh”.

Config file directory [/etc/webmin]:
# Leave as default, or change as you wish

Log file directory [/var/webmin]:
# Leave as default, or change as you wish

Full path to perl (default /usr/bin/perl):
# Leave as default, or change as you wish

Web server port (default 10000):
# Leave as default or change it to what ever port you want.

Login name (default admin):
# Leave as default, or change as you wish

Login password:
# Choose a password, it will not display anything while you type

Password again:
# Self explanatory

Use SSL (y/n):
# Of course ‘y’

Start Webmin at boot time (y/n):
# Once agian… ‘y’

It will not finnish up the installation and you will be able to login by using localhost:port or routerip:port like http://localhost:10000

Masquerading
Masquerading is also known as NAT. To enable it, login to Webmin, go to the networking section, and click on firewall. It will ask you to configure it now. press “Do network address translation on external interface:” and choose the external interface (the one that is connected to the internet) and click on “Enable firewall at boot time?” then click on “Setup Firewall”.

Now you must add rules to your firewall to allow traffic coming from the internal network, loopback, and traffic related to an outgoing connection (so that you may recieve a response to your requests).
To allow traffic from the internal network, under “Incoming packets (INPUT)” press add rule. Give the rule a comment (name) like internal network and press the button by the “Accept” in green writing. Then down to “Incoming interface” put equals and put your internal interface, in the picture below it is eth0. Scroll down and press create.


Now do the same but put lo as incoming interface.

Now you must create another rule for existing connection. Put a comment and press accept. For incoming interface put equals and put your external interface (eth1 for me). Scroll down to “Connection States” and put equals and select both “Existing connection (ESTABLISHED)” and “Related to existing (RELATED)” and press create.

Now you must drop external connections that do not meet any of the other rules, so set the default action of “Incoming packets (INPUT)” to drop and press the button.

Scroll down to the bottom and press apply configuration.

Now go to the System section and click “Bootup and Shutdown”. Click “Create a new bootup and shutdown action”. Make the name “webmin-ipt” without quotes, make the description whatever you please, and for bootup commands, put “/bin/echo 1 > /proc/sys/net/ipv4/ip_forward” and make a new line and put “/sbin/iptables-restore /etc/webmin/firewall/iptables.save” then press create. Find the bootup command you just created in the list and click it then press Start Now.

Configure DHCP
In webmin, go to servers and press DHCP Server and click Module Config.
Replace (without quotes)
DHCP server config file with “/etc/dhcp3/dhcpd.conf”
DHCP server executable with “/usr/sbin/dhcpd3”
Command to start DHCP server with “/etc/init.d/dhcp3-server start”
Command to apply configuration with “/etc/init.d/dhcp3-server restart”
Command to stop DHCP server with “/etc/init.d/dhcp3-server stop”
Path to DHCP server PID file with “/var/run/dhcp3-server/dhcpd.pid”
DHCP server lease file with “/var/lib/dhcp3/dhcpd.leases”
and press save.

Now press “Add a new subnet” and put a description of this subnet. For network address, make it the same as the internal address but with 0 at the end, for example my internal NIC is 192.168.1.1 so I will put 192.168.1.0 for network address. For address ranges put the range of addrseses for your DHCP server to assign. For netmask put the same as your subnet, most are 255.255.255.0 and press create.

Once created, press the new icon that was just created with the network address you choose under it and scroll down to the bottom and click “Edit Client Options”. Fill in Subnet mask with your subnet, default routers and dns servers with your internal IP and broadcast address with the internal ip but 255 at the end (for example my internal ip is 192.168.1.1 so I will put 192.168.1.255 for broadcast) and press save then press start server.

Your computer will now be a DHCP server, router, and DNS server. To do port forwarding, go to the firewall settings in webmin and go to the Network Address Translation (nat) IPTable. From there you can add rules to Packets before routing (PREROUTING).

Posted in Debian, Linux, Mandriva, Networking, Opetaring System, Red hat, Ubuntu | Tagged: | Leave a Comment »

Welcome!

Posted by petanidigital on January 20, 2008

Welcome to BangRajan site hope you glad to get my information on this site can satisfied you and wish help you

Posted in Welcome | 1 Comment »