Showing posts with label Tips&Tricks. Show all posts
Showing posts with label Tips&Tricks. Show all posts

Monday, 1 August 2016

Iptables linux firewall simple command

What is Iptables ?

Iptables is a rule based firewall and it is pre-installed on Linux operating system which control the incoming and outgoing traffic. We can create chain rule and block black listed IP.

For example:

Block IP:

If we got DDOS attack on web server from 192.168.1.10 now we can block the inbound traffic from this IP using Iptabes.

iptables -D INPUT -s 192.168.1.10 -j DROP

or range of IP

iptables -A INPUT -s 192.168.0.0/24 -j DROP

Now from 192.168.1.10 will not able to access anything on your server.

Restricting access with mac address :

iptables -A INPUT -m mac --mac-source 0E:0F:EA:91:04:08 -j DROP

iptables -A INPUT -m mac --mac-source 0E:0F:EA:91:04:08 -j ACCEPT


Restricting access on port:

iptables -A INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 22 -j ACCEPT

iptables -A INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 25-j ACCEPT

Port 22(SSH) and 25(SMTP)  is accessible only from 192.168.1.0/24

List of rule :

iptables -L -n -v

-L : List rules.
-v : Display detailed information. 
-n : Display IP address and port in numeric format.

Deleting rule :

iptables -D INPUT -s 192.168.0.10 -j DROP

iptables -D INPUT -m mac --mac-source 0E:0F:EA:91:04:08 -j DROP

iptables -D INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 22 -j ACCEPT







Tuesday, 19 November 2013

Increase your internet Speed and computer speed

Slow internet connection and computer really costs time and makes feel annoying. it is possible to make your internet much better then it was in the past.

1.Goto run and type "msconfig"  by pressing "Windows key + R".


2.Then goto "Startup" tab and untick the "unnecessary updates" and "startup programs".




3.Hit the "OK" button.

4.and also off the "windows update" .you can find windows update at
"Control Panel\System and Security\Windows Update\Change settings"



Some basic Tricks :-

1. Use "IDM" To Boost your Downloading Speed.
2. Use A  Anti-virus in your Computer.
3. Remove all Unwanted Add-ons, Software,unwanted files form your Computer.


How to use ping command

Ping stands for "Packet InterNet Groper" . The ping command is commonly used to check for network errors. Ping command used to verify if a network data packet is capable of being distributed to an address without errors. This command used in windows and linux etc.

Syntax :

ping target_host  [-options]


Examples:

ping google.com -t

ping 192.168.1.1 -t

The above ping command continuously  sends the packet to the target host until the user presses "Ctrl+c"





C:\Users\home>ping /?

Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
            [-r count] [-s count] [[-j host-list] | [-k host-list]]
            [-w timeout] [-R] [-S srcaddr] [-4] [-6] target_name

Options:
    -t             Ping the specified host until stopped.
                   To see statistics and continue - type Control-Break;
                   To stop - type Control-C.
    -a             Resolve addresses to hostnames.
    -n count       Number of echo requests to send.
    -l size        Send buffer size.
    -f             Set Don't Fragment flag in packet (IPv4-only).
    -i TTL         Time To Live.
    -v TOS         Type Of Service (IPv4-only. This setting has been deprecated

                   and has no effect on the type of service field in the IP Head