Wednesday, 14 March 2018

Dynamic NAT Overload or PAT | Cisco

4 simple steps to configure PAT/ NAT Overloading in Cisco IOS

1. create list for local network
2. create pool of puchassd SINGLE IP
3. merge/attach both above to nat inside

4. set inside and outside interfaces

access-list 1 permit 192.168.1.0 0.0.0.255
ip nat pool pool1 1.1.1.50 1.1.1.50 netmask 255.0.0.0
ip nat inside source list 1 pool pool1 overload
int fa0/0
ip nat inside
int fa0/1
ip nat outside
show ip nat translation


Friday, 9 March 2018

Administrative Distance of different Routing Protocols | Networks

Route Source
Default Distance Values
Connected interface
0
Static route
1
Enhanced Interior Gateway Routing Protocol (EIGRP) summary route
5
External Border Gateway Protocol (BGP)
20
Internal EIGRP
90
OSPF
110
Intermediate System-to-Intermediate System (IS-IS)
115
Routing Information Protocol (RIP)
120
Exterior Gateway Protocol (EGP)
140
Unknown*
255

Low administrative distance takes precedence in route distribution.

Suppose we have 2 routing protocols RIP and EIGRP; 120 and 100 respectively. EIGRP will be preferred over the RIP because of the administrative distance is 100.

However, Administrative distance can be changed to take precedence

For instance, lets enable RIP route by using distance command to modify distance

Router1#show ip route
Router1(config)#router rip
Router1(config-router)#distance 90

Now check again with show ip route command
You will see that RIP has taken precedence over EIGRP.



IGP vs EGP and ASN | Network

Interial Gateway Protocol (IGP):

IGP is a routing protocol that handles routing within a SINGLE autonomous system(AS).
RIP, RIPv2, IGRP, EIGRP and OSPF are the examples of IGP.

Exterior Gateway Protocol (EGP):
EGP handles routing betweeen difference AUTONOMOUS SYSTEMS (ASs).
BGP is the example of EGP.

What is Autonomous system number (ASN)?

An ASN is globally unique number which enables the system to exchange EXTERIOR routing information with  other neighboring ASs.

reference: https://www.cisco.com/c/en/us/about/press/internet-protocol-journal/back-issues/table-contents-12/autonomous-system-numbers.html

Wednesday, 7 March 2018

Find and kill a process which is listening on port 8080 | Windows


netstat –aon | find "<port number>"
Example:
netstat -ano -t  | findstr LISTENING | findstr :8080


now kill using taskkill command

taskkill /F /pid xxx

or kill by name for example.
taskkill /im notepad.exe

Tip: to find a string in a file using findstr:
findstr /i "helloworld" abc.txt
or
findstr /i "^hell*rld" abc.txt


------------------------------

Linux:
my best command:
netstat -tulpen

example:
netstat -tulpn | grep LISTEN | grep '(8080 |8081 |8082 | xxx)'

or

$ lsof -i tcp:1555