HOW to create Equal bandiwdth sharing among users

This example shows how to equally share 10Mibps download and 2Mibps upload among active users in the network 192.168.0.0/24. If Host A is downloading 2 Mibps, Host B gets 8 Mibps and vice versa. There might be situations when both hosts want to use maximum bandwidth (10 Mibps), then they will receive 5 Mibps each, the same goes for upload. This setup is also valid for more than 2 users.



Interface public = 10.10.58.1
Interface local = 192.168.1.1/24


1. create ip NAT





 ip firewall nat add chain=srcnat src-address=192.168.0.0/24
to-addresses=10.10.58.1 to-ports=0-65535

2. mark all traffic, coming from local network 192.168.0.0/24 with a mark users:




 ip firewall nat add chain=srcnat src-address=192.168.0.0/24
to-addresses=10.10.58.1 to-ports=0-65535
/ip firewall mangle add chain=forward src-address=192.168.0.0/24 \
action=mark-connection new-connection-mark=users-con
/ip firewall mangle add connection-mark=users-con action=mark-packet \
new-packet-mark=users chain=forward



3.Now we will add 2 new PCQ types. The first, called pcq-download will group all traffic by destination address. As we will attach this queue type to the Local interface, it will create a dynamic queue for each destination address (user) which is downloading to the network 192.168.0.0/24. The second type, called pcq-upload will group the traffic by source address. We will attach this queue to the Public interface so it will make one dynamic queue for each user who is uploading to Internet from the local network 192.168.0.0/24.




 /queue type add name=pcq-download kind=pcq pcq-classifier=dst-address
/queue type add name=pcq-upload kind=pcq pcq-classifier=src-address


4. make a queue tree for download&upload traffic:




 /queue tree add name=Upload parent=Public max-limit=2048000
/queue tree add parent=Upload queue=pcq-upload packet-mark=users
/queue tree add parent=Local queue=pcq-download packet-mark=users
/queue tree add parent=Public queue=pcq-upload packet-mark=users

ospf cisco vs mikrotik

This is how to to implement dynamic routing OSPF with mikrotik combine with OSPF with Cisco router.

1. we have to configure in cisco router with OSPF routing.
#conf t
(config)#router ospf 200
(config-router)#redistribute static subnets
(config-router)#network 203.78.224.0 0.0.0.255 area 0
(config-router)# network 203.78.226.0 0.0.0.255 area 0
(config-router)# network 203.78.227.0 0.0.0.255 area 0
(config-router)# network 203.78.228.0 0.0.0.255 area 0
(config-router)# network 203.78.229.0 0.0.0.255 area 0
(config-router)# network 203.78.230.0 0.0.0.255 area 0
2. configure in mikrotik router
set OSPF setting interface:

Add interface ospf:



Add OSPF areas


Add OSPF network



Now, see log in cisco and mikrotik:
#sh ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface
203.78.236.227 1 FULL/BDR 00:00:37 203.78.227.21 FastEthernet1/1
203.78.227.34 1 FULL/BDR 00:00:36 203.78.227.34 FastEthernet1/0.5

[user@mikrotik] /routing ospf neighbor> pr
0 router-id=203.78.236.241 address=203.78.227.33 interface=ether1
priority=1 dr-address=203.78.227.33 backup-dr-address=203.78.227.34
state="Full" state-changes=5 ls-retransmits=0 ls-requests=0 db-summaries=0
adjacency=2w6d1h3m58s

ospf mikrotik command

this is manual ospf command in mikrotik. for more complete you can visit mikrotik.com
Submenu level: /routing ospf
Description

In this section you will learn how to configure basic OSPF settings.
Property Description
distribute-default (never | if-installed-as-type-1 | if-installed-as-type-2 | always-as-type-1 | always-as-type-2; default: never) - specifies how to distribute default route. Should be used for ABR (Area Border router) or ASBR (Autonomous System boundary router) settings
never - do not send own default route to other routers
if-installed-as-type-1 - send the default route with type 1 metric only if it has been installed (a static default route, or route added by DHCP, PPP, etc.)
if-installed-as-type-2 - send the default route with type 2 metric only if it has been installed (a static default route, or route added by DHCP, PPP, etc.)
always-as-type-1 - always send the default route with type 1 metric
always-as-type-2 - always send the default route with type 2 metric

metric-bgp (integer; default: 20) - specifies the cost of the routes learned from BGP protocol

metric-connected (integer; default: 20) - specifies the cost of the routes to directly connected networks

metric-default (integer; default: 1) - specifies the cost of the default route

metric-rip (integer; default: 20) - specifies the cost of the routes learned from RIP protocol

metric-static (integer; default: 20) - specifies the cost of the static routes

redistribute-bgp (as-type-1 | as-type-2 | no; default: no) - with this setting enabled the router will redistribute the information about all routes learned by the BGP protocol

redistribute-connected (as-type-1 | as-type-2 | no; default: no) - if set, the router will redistribute the information about all connected routes, i.e., routes to directly reachable networks

redistribute-rip (as-type-1 | as-type-2 | no; default: no) - with this setting enabled the router will redistribute the information about all routes learned by the RIP protocol

redistribute-static (as-type-1 | as-type-2 | no; default: no) - if set, the router will redistribute the information about all static routes added to its routing database, i.e., routes that have been created using the /ip route add command

router-id (IP address; default: 0.0.0.0) - OSPF Router ID. If not specified, OSPF uses the largest IP address configured on the interfaces as its router ID

Debian installation problem with SATA hardisk

this is answer from bugs.debian.org :

Try booting with 'linux26' since the default is 2.4 kernel, which does
not like sata in general. 2.6 has better sata support, although if the
machine is very new it may still not be supported.

Sarge was released in the summer last year, so any hardware made by
about the begining of 2005 is supported in general (there are exceptions
of course). Anything that only came out in the second half of 2005 is
almost certainly unsupported.

That is true of all distributions in general. Hardware newer than the
release of the distribution almost never works right.

How to install Quagga on Debian linux(about guagga)

1. QUAGGA DAEMONS:

You have to activate the Quagga daemons matching the routing protocols you want to set on your router.
zebra:
bgpd:
ospfd:
ospf6d:
ripd:
ripngd: Interface declaration and static routing
BGP routing protocol
OSPF routing protocol
OSPF IPv6 routing protocol
RIP v2 routing protocol
RIP Ipv6 routing protocol
In the example below, the zebra and IPv4 OSPF daemon have been activated.

#vim /etc/quagga/daemons
zebra=yes
bgpd=no
ospfd=yes
ospf6d=no
ripd=no
ripngd=no

Restart the Quagga service:

#/etc/init.d/quagga restart
Stopping Quagga daemons (prio:0): ospfd zebra (bgpd) (ripd) (ripngd) (ospf6d) (isisd).
Removing all routes made by zebra.
Nothing to flush.
Loading capability module if not yet done.
Starting Quagga daemons (prio:10): zebra ospfd.

You can check the Quagga daemons status:

#ps -ef | grep quagga
UID PID PPID C STIME TTY TIME CMD
quagga 4632 1 0 22:25 ? 00:00:00 /usr/lib/quagga/ospfd --daemon
quagga 4636 1 0 22:25 ? 00:00:00 /usr/lib/quagga/zebra --daemon
If a Quagga daemon doesn't stop properly, you can kill it manually and start the quagga service:

#kill -9 "UID number"
#/etc/init.d/quagga start


2. CONFIGURATION FILES: (/etc/quagga/*.conf files)

You must create a configuration file (even if it is empty) each time you activate a Quagga daemon.
Each daemon is associated with a specific file name:

zebra:
bgpd:
ospfd:
ospf6d:
ripd:
ripngd: zebra.conf
bgpd.conf
ospfd.conf
ospf6d.conf
ripd.conf
ripngd.conf
To create the config files, copy the sample config files as follows:
In our example, as we activated the zebra and ospfd daemons; we need to create the zebra.conf and ospfd.conf files.

#cp /usr/share/doc/quagga/examples/zebra.conf.sample /etc/quagga/zebra.conf
#cp /usr/share/doc/quagga/examples/ospfd.conf.sample /etc/quagga/ospfd.conf
Another way to do it is to create two empty files called /etc/quagga/ospfd.conf and /etc/quagga/zebra.conf. But in this case you cannot telnet a daemon, you need to configure the telnet permissions with vtsh (see below).

Finally, give user and group ownership to respectively quagga and quaggavty to the files inside the /etc/quagga directory:

#chown quagga.quaggavty /etc/quagga/*.conf
#chmod 640 /etc/quagga/*.conf
Restart the Quagga service:

#/etc/init.d/quagga restart


3. DEBIAN.CONF FILE

By default, the Quagga daemons are listening only to the loopback interface 127.0.0.1. It means that you can telnet a daemon only on its loopback address 127.0.0.1 and thus cannot access it remotely.

If you want to telnet a Quagga daemon remotely you can, in the /etc/quagga/debian.conf file. Either indicate one or several IP addresses or remove the -A option meaning that you can telnet a daemon on any of its IP addresses.

Here are two examples:

The ospfd daemon is listening to the 127.0.0.1 and 192.168.1.104 IP addresses.
ospfd_options=" --daemon -A 127.0.0.1 192.168.1.104"

The zebra daemon is listening to all the Linux interfaces IP addresses. We recommend using this setting. If you want to filter who can access to your router, configure access lists on the router software.
zebra_options=" --daemon "

Here is the recommended debian.conf file:

#vim /etc/quagga/debian.conf

# If this option is set the /etc/init.d/quagga script automatically loads
# the config via "vtysh -b" when the servers are started.
# Check /etc/pam.d/quagga if you intend to use "vtysh"!
#
vtysh_enable=yes
zebra_options=" --daemon -A "
bgpd_options=" --daemon -A "
ospfd_options=" --daemon -A "
ospf6d_options="--daemon -A "
ripd_options=" --daemon -A "
ripngd_options="--daemon -A "
isisd_options=" --daemon -A "

The "vtysh_enable=yes" setting is required to access the Quaggga router via vtysh. (see vtysh section).

Restart the Quagga service

#/etc/init.d/quagga restart

4. VTYSH


As indicated in the Quagga introduction, you can access the daemons by telnetting their port number because each daemon has its own configuration file and terminal interface.

zebra:
ripd:
ripng:
ospfd:
bgpd:
ospf6d: 2601
2602
2603
2604
2605
2606
By instance, to access the ospfd daemon:

#telnet localhost 2604
As it's not very practical to configure your router by telnetting its daemons separately, vtysh has been created to configure everything in one single interface.

To use vtysh, you must first create its configuration file as follows:

#cp /usr/share/doc/quagga/examples/vtysh.conf.sample /etc/quagga/vtysh.conf

/etc/quagga/vtysh.conf
!
! Sample
!
! service integrated-vtysh-config
hostname quagga-router
username root nopassword
!

Apply correct permissions and restart Quagga:

#chown quagga.quaggavty /etc/quagga/*.conf
#chmod 640 /etc/quagga/*.conf
#/etc/init.d/quagga restart
In the example above the "service integrated-vtysh-config" setting has been disabled (recommended). In this case, when you save the config under vtysh, it will be stored in separate files depending on the protocols you activated.
Below, an example where the Quagga configuration is saved under vtysh. (The zebra and ospfd daemons have been enabled.)

#vtysh
quagga-router#write
Configuration saved to /etc/quagga/zebra.conf
Configuration saved to /etc/quagga/ospfd.conf

If you activate "service integrated-vtysh-config", the configuration under vtysh will be saved in one file called Quagga.conf in the /etc/quagga/ directory.
With this setting, when you access a daemon via telnet, the daemon will look first to the Quagga.conf file before looking for its own file. This means that, when you telnet a device, there can be a difference between what you see after the "show run" command and the content of the associated file, for example zebra.conf.

#vtysh
quagga-router#write
Configuration saved to /etc/quagga/Quagga.conf

It is recommended to disable "service integrated-vtysh-config" because if this setting is enabled and in case of a syntax error in the Quagga.conf file, this can lead to all your daemons being unable to start up. This will not be case when "service integrated-vtysh-config" is disabled because the configurations are stored in separate files.

Check that the default "vtysh_enable=yes" setting are configured in your /etc/quagga/debian.conf file. You can read the previous paragraph about the debian.conf file to get more information.

Then it's useful to add the "VTYSH_PAGER=more" setting in your /etc/environment file, otherwise you will see an unfriendly "(END)" blinking in the left-down corner of the screen each time your enter a command and will need to press the "q" key to continue.

#echo VTYSH_PAGER=more > /etc/environnement
Log off and log on to enable the environment setting. You can now access the Quagga router with the vtysh command:

#vtysh
Hello, this is Quagga (version 0.99.6).
Copyright 1996-2005 Kunihiro Ishiguro, et al.

quagga-router#

If you want to run a Quagga command from the Linux shell:

#vtysh -c "command"
For instance, vtysh -c "show ip route" will display the Quagga routing table.

You can use ping and traceroute to perform connectivity checks from the vtysh prompt. Of course, these two programs need to be installed on the Linux machine. Ping is generally installed by default but traceroute often not.
To install traceroute:

#apt-get install traceroute

5. IP FORWARDING:


IP forwarding is required to transfer packets between the network interfaces of a Linux system.
See a picture of the Linux kernel routing.

#echo "1" > /proc/sys/net/ipv4/ip_forward
The command above will add the "1" value inside the /proc/sys/net/ipv4/ip_forward file and thus activate the IP forwarding.
If you want to keep the IP forwarding after a Linux reboot:

#echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
It is possible to check the ip_forwarding status under the Quagga router:

#show ip forwarding
IP forwarding is on

In this case the IP forwarding is activated.

PHP Redirect Sript Web page

You can use a simple PHP script to redirect a user from the page they entered to a different web page. One reason you may want to do this is that the page they are trying to access no longer exists. Using this method, they can be seamlessly transfered to the new page without having to click a link to continue.


go to web file you want to redirect :
add this source code or change all source with this one for more simple:


<?php header( 'Location: http://www.yoursite.com/new_page.html' ) ?>

You need to replace the URL above with the URL you wish to direct to.

Top 10 Web Hosting — Best Web Hosts (2009)

from webhostinggeeks, based on review : Cheap professional web hosting services under $10 a month; all webhosting plans include at least one free domain name registration and 30 day money back guarantee. Review your web host — let other webmasters know the best and the worst!

Rank Web Hosting Provider Features Bonus Features Hosting Review
1 Inmotion web hosting rating - 5 stars
Business Web Hosting Space: Unlimited
Traffic: Unlimited
Price: $8.95 Free Domain Name,
Choice of Data Centers,
Top Technical Support Inmotion Review
Host Rating: 98%
Rate and Review a Host Review Inmotion

2 JustHost web hosting rating - 5 stars
Editor's Choice Hosting Space: Unlimited
Traffic: Unlimited
Price: $4.95 Free Domain Forever,
Host Unlimited Domains,
$75 Marketing Bonus JustHost Review
Host Rating: 97%
Rate and Review a Host Review JustHost

3 WebHostingPad web hosting rating - 5 stars

Cheap Reliable Hosting Space: Unlimited
Traffic: Unlimited
Price: $3.96 Free Domain Forever,
Host Unlimited Domains,
$100 Marketing Bonus WebHostingPad Review
Host Rating: 97%
Rate and Review a Host Review WebHostingPad

4 Bluehost web hosting rating - 4.5 stars
Unlimited Web Hosting Space: Unlimited
Traffic: Unlimited
Price: $4.95 Free Domain Forever,
Host Unlimited Domains,
$75 Marketing Bonus Bluehost Review
Host Rating: 96%
Rate and Review a Host Review Bluehost

5 FatCow web hosting rating - 4.5 stars
Cheap Business Hosting Space: Unlimited
Traffic: Unlimited
Price: $4.83 Free Domain Forever,
Host Unlimited Domains,
$75 Marketing Bonus FatCow Review
Host Rating: 96%
Rate and Review a Host Review FatCow

6 Hostmonster web hosting rating - 4.5 stars
Cheap Unix Hosting Space: Unlimited
Traffic: Unlimited
Price: $4.95 Free Domain Forever,
Host Unlimited Domains,
$75 Marketing Bonus Hostmonster Review
Host Rating: 96%
Rate and Review a Host Review Hostmonster

7 Globat web hosting rating - 4 stars
Cheap Web Hosting Space: Unlimited
Traffic: Unlimited
Price: $4.44 Free Domain Name,
Host Unlimited Domains,
$55 Marketing Bonus Globat Review
Host Rating: 95%
Rate and Review a Host Review Globat

8 Lunarpages web hosting rating - 3.5 stars
Cheap Shared Hosting Space: Unlimited
Traffic: Unlimited
Price: $4.95 Free Domain Forever,
Host Unlimited Domains,
Free $775 in Software Lunarpages Review
Host Rating: 94%
Rate and Review a Host Review Lunarpages

9 GoDaddy web hosting rating - 3.5 stars
Largest Web Hosting Space: Unlimited
Traffic: Unlimited
Price: $12.74 Free Domain Name,
Host Unlimited Domains,
Free SSL Certificate GoDaddy Review
Host Rating: 93%
Rate and Review a Host Review GoDaddy

10 Yahoo web hosting rating - 3.5 stars
Reliable Web Hosting Space: Unlimited
Traffic: Unlimited
Price: $8.96 Free Domain Name,
$100 Yahoo Credit,
$50 Google Credit Yahoo Review
Host Rating: 93%
Rate and Review a Host Review Yahoo