Wednesday, January 30, 2013

Monday, August 6, 2012

vi / vim show line number command



To display line numbers along the left side of a window, type any one of the following:
:set number
or
:set nu

(Fig.01: Vi / Vim line numbers in action - click to enlarge image)
To turn off line number again enter the same command:
:set nu!
If you need number every time you start vi/vim, append following line to your ~/.vimrc file:
set number


How to forward mail to an external email address


In Exchange Server 2003, mail for a recipient can be forwarded to an alternate recipient by modifying the recipient’s Delivery Options in ADUC | recipient -> properties | Exchange General tab.
Figure 1: Use Delivery Options to auto forward email to an alternate recipient in Exchange 2003
Forwarding mail to an external address in Exchange 2010 and Exchange 2007
1Create a MailContact
  1. Expand Recipeint Configuration | Mail Contact
  1. In the Action pane, click New Mail Contact
  1. To create a new Contact object, leave the default (New Contact) selected | click Next
  1. Type First name, Last name
  1. Click Edit to add the external email address
  1. Click New to complete creation of new MailContact
2Forward mail for a recipient to the MailContact
  1. Expand Recipeint Configuration | Mailbox | select mailbox | properties | Mail Flow Settings tab | Delivery Options
  1. Under Forwarding address, select Forward to
  1. Click Browse to select the MailContact
  1. Screenshot: Delivery Options -< Forwarding Address in Exchange 2007
  1. Figure 2:
  2.  Modifying Delivery Options to forward email to an alternate recipient
  1. Optional:
  2.  If a copy of the message needs to be delivered to both the external recipient and the original recipient’s mailbox, select the Deliver message to both forwarding address and mailbox
Listing users with forwarding enabled
Automatic forwarding and Remote Domains
Figure 3: The Allow automatic forward setting for remote domains only impacts client-side automatic forwarding using mechanisms like Inbox Rules, and is disabled by default.
Screenshot: Delivery Options to auto forward email to an alternate recipient in Exchange 2003
If you need to forward mail to an external email address, you can’t simply type the address in theForward to: field on the Delivery Options page. A (mail-enabled) Contact needs to be created in ADfirst, and Delivery Options modified to point to the Contact.
In Exchange 2010/2007, these tasks remain the same. However, instead of using ADUC to accomplish them, you use the EMC or the Shell (aka “EMS“). The new term for a Contact is MailContact.
Create a MailContact using the EMC:
Alternatively, use the Shell to create a new MailContact:
New-MailContact -Name “Foo User” -ExternalEmailAddress “foo@externaldomain.com
Next, we set the recipient’s Delivery Options to deliver to the alternate recipient.
Now that we have a MailContact created for the external recipient’s email address, we can forward mail for the Exchange recipient to the MailContact. To configure mail forwarding using the EMC:
To configure mail forwarding using the Shell:
Set-Mailbox “Joe Adams” -ForwardingAddress “foo@externaldomain.com”
To deliver a copy to the mailbox (in addition to the external email address – equivalent of step 4 above):
Set-Mailbox “Joe Adams” -ForwardingAddress “foo@externaldomain.com” -DeliverToMailboxAndForward $true
This command lists mailboxes with auto forwarding enabled:
Get-Mailbox | where {$_.ForwardingAddress -ne $null} | ft name,forwardingaddress
Remote Domains define a bunch of settings, such as message formats, character sets, and OOFSfor messages sent to specified domains outside your Exchange organization. The default Remote Domain setting for the address space * (the asterisk character) applies to all external domainsexcept the ones for which you’ve created a Remote Domain for.
Screenshot: Remote Domain properties
The Allow automatic forward setting for remote domains applies only to client-side forwardingusing mechanisms like Inbox Rules. For instance, if a user creates a rule in Microsoft Outlook to automatically forward mail to an external email address, the default setting (for address space *) doesn’t allow it. To enable automatic client-side forwarding of mail to external addresses, select the Allow automatic forward checkbox in a remote domain’s properties | Format of original message sent as attachment to journal report tab (Yes, in Exchange 2007 the tab is mislabeled. It is the “Message Formats” tab… :).
Server-side email forwarding configured by an administrator, as shown in this post, is not impacted by this setting.

Monday, June 11, 2012

Monday, October 17, 2011

Remove My Documents from the Desktop

Windows 95, 98 and Me
[HKEY_CURRENT_USER\Software\Classes\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}\ShellFolder]
Windows NT, 2000 and XP
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}\ShellFolder]
Modify the value called "Attributes" and set it to either "0xf0500174" to hide or "0xf0400174" to display My Documents.
Click on a blank area of desktop and press F5 to refresh for the change to take effect.
Note: This tweak can also by used on a system wide basis by entering the same values under the [HKEY_LOCAL_MACHINE] hive.
Registry Editor Example
|NameTypeData|
|(Default)REG_SZ(value not set)|
|AttributesREG_DWORD0xf0500174 (4031775092)|
-
|HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\...|

Tuesday, October 4, 2011

EIGRP configuration example for CCNA



eigrp configuration

R1
 
R1(config)#router eigrp ?
<1-65535> Autonomous system number
R1(config)#router eigrp 1
R1(config-router)#network 172.16.0.0
R1(config-router)#network 192.168.10.0
R1(config-router)#
%DUAL-5-NBRCHANGE: IP-EIGRP 1: Neighbor 172.16.3.2 (Serial0/0/0) is up: new adjacency
R2
R2(config-router)#ne
R2(config-router)#network 172.16.0.0
R2(config-router)#
%DUAL-5-NBRCHANGE: IP-EIGRP 1: Neighbor 172.16.3.1 (Serial0/0/0) is up: new adjacency
network 192.168.10.0
R2(config-router)#
R3
R3(config)#router eigrp 1
R3(config-router)#network 192.168.0.0 < not worked : enter classfull n/w
R3(config-router)#network 192.168.10.0
R3(config-router)#
%DUAL-5-NBRCHANGE: IP-EIGRP 1: Neighbor 192.168.10.9 (Serial0/0/0) is up: new adjacency
%DUAL-5-NBRCHANGE: IP-EIGRP 1: Neighbor 192.168.10.5 (Serial0/0/1) is up: new adjacency
R3(config-router)#network 192.168.1.0
R3#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
D 172.16.0.0/16 [90/540160] via 192.168.10.9, 00:01:11, Serial0/0/0
[90/540160] via 192.168.10.5, 00:01:11, Serial0/0/1
D 172.16.1.0/24 [90/2684416] via 192.168.10.9, 00:01:11, Serial0/0/0
D 172.16.2.0/24 [90/2684416] via 192.168.10.5, 00:01:11, Serial0/0/1
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
D 192.168.1.0/24 is a summary, 00:01:08, Null0
C 192.168.1.0/29 is directly connected, FastEthernet0/0
192.168.10.0/24 is variably subnetted, 3 subnets, 2 masks
D 192.168.10.0/24 is a summary, 00:01:08, Null0
C 192.168.10.4/30 is directly connected, Serial0/0/1
C 192.168.10.8/30 is directly connected, Serial0/0/0
R3#
------------------------------------------------------------------------------------------------------
DISABLING AUTOSUMMARIZATION
R3(config-router)#no auto-summary
%DUAL-5-NBRCHANGE: IP-EIGRP 1: Neighbor 192.168.10.5 (Serial0/0/1) is up: new adjacency
%DUAL-5-NBRCHANGE: IP-EIGRP 1: Neighbor 192.168.10.9 (Serial0/0/0) is up: new adjacency
R3(config-router)#
R3(config-router)#^Z
R3#
%SYS-5-CONFIG_I: Configured from console by console
R3#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
D 172.16.1.0/24 [90/540160] via 192.168.10.5, 00:00:25, Serial0/0/1
D 172.16.2.0/24 [90/540160] via 192.168.10.9, 00:00:25, Serial0/0/0
D 172.16.3.0/30 [90/2681856] via 192.168.10.5, 00:00:25, Serial0/0/1
[90/2681856] via 192.168.10.9, 00:00:25, Serial0/0/0
192.168.1.0/29 is subnetted, 1 subnets
C 192.168.1.0 is directly connected, FastEthernet0/0
192.168.10.0/30 is subnetted, 2 subnets
C 192.168.10.4 is directly connected, Serial0/0/1
C 192.168.10.8 is directly connected, Serial0/0/0
R3#
------------------------------------------------------------------------------------------------------
MANUAL SUMMARIZATION
simulate lAN on R3
R3(config)#interface loopback 0
R3(config-if)#ip address 192.168.0.1 255.255.255.0
R3(config)#interface loopback 2
R3(config-if)#ip address 192.168.2.1 255.255.255.0
R3(config)#interface loopback 3
R3(config-if)#ip address 192.168.3.1 255.255.255.0
R3#
R3#sh ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.1.1 YES manual up up
FastEthernet0/1 unassigned YES unset administratively down down
Serial0/0/0 192.168.10.10 YES manual up up
Serial0/0/1 192.168.10.6 YES manual up up
Loopback0 192.168.0.1 YES manual up up
Loopback2 192.168.2.1 YES manual up up
Loopback3 192.168.3.1 YES manual up up
Vlan1 unassigned YES unset administratively down down
R3#
R3(config)#router eigrp 1
R3(config-router)#network 192.168.0.0
R3(config-router)#network 192.168.2.0
R3(config-router)#network 192.168.3.0
R3(config-router)
now see routing table on R2

R2#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/30 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, Loopback0
172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
D 172.16.1.0/24 [90/1052160] via 192.168.10.10, 00:05:43, Serial0/0/1
C 172.16.2.0/24 is directly connected, FastEthernet0/0
C 172.16.3.0/30 is directly connected, Serial0/0/0
D 192.168.0.0/24 [90/642304] via 192.168.10.10, 00:01:24, Serial0/0/1
192.168.1.0/29 is subnetted, 1 subnets
D 192.168.1.0 [90/540160] via 192.168.10.10, 00:05:43, Serial0/0/1
D 192.168.2.0/24 [90/642304] via 192.168.10.10, 00:00:18, Serial0/0/1
D 192.168.3.0/24 [90/642304] via 192.168.10.10, 00:00:15, Serial0/0/1
192.168.10.0/30 is subnetted, 2 subnets
D 192.168.10.4 [90/1026304] via 192.168.10.10, 00:05:43, Serial0/0/1
C 192.168.10.8 is directly connected, Serial0/0/1
R2#
The routes in Example above can be summarized into one supernet route advertised by R3 to both
R1 and R2. A supernet is a collection of contiguous classful network addresses aggregated into one
route. Instead of sending four /24 routes for the classful networks 192.168.0.0, 192.168.1.0,
192.168.2.0, and 192.168.3.0, we can configure a manual summary route as 192.168.0.0/22.
Manual summary routes must be configured on the interface that you want the summary route to
be sent out of. The syntax for manual summary routes with EIGRP is as follows:
Router(config-if)#ip summary-address eigrp as-number network-address subnet-mask
Because R3 has two EIGRP neighbors, the EIGRP manual summarization in configured on both
Serial 0/0/0 and Serial 0/0/1, as shown in Example 13-
R3(config)#interface serial 0/0/0
R3(config-if)#ip summary-address eigrp 1 192.168.0.0 255.255.252.0
R3(config-if)#
%DUAL-5-NBRCHANGE: IP-EIGRP 1: Neighbor 192.168.10.5 (Serial0/0/1) is up: new adjacency

%DUAL-5-NBRCHANGE: IP-EIGRP 1: Neighbor 192.168.10.9 (Serial0/0/0) is up: new adjacency
R3(config)#interface serial 0/0/1
R3(config-if)#ip summary-address eigrp 1 192.168.0.0 255.255.252.0
R3(config-if)#
%DUAL-5-NBRCHANGE: IP-EIGRP 1: Neighbor 192.168.10.9 (Serial0/0/0) is up: new adjacency
%DUAL-5-NBRCHANGE: IP-EIGRP 1: Neighbor 192.168.10.5 (Serial0/0/1) is up: new adjacency
^Z
R3#
R2#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/30 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, Loopback0
172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
D 172.16.1.0/24 [90/1052160] via 192.168.10.10, 00:00:06, Serial0/0/1
C 172.16.2.0/24 is directly connected, FastEthernet0/0
C 172.16.3.0/30 is directly connected, Serial0/0/0
D 192.168.0.0/22 [90/540160] via 192.168.10.10, 00:00:07, Serial0/0/1
192.168.10.0/30 is subnetted, 2 subnets
D 192.168.10.4 [90/1026304] via 192.168.10.10, 00:00:07, Serial0/0/1
C 192.168.10.8 is directly connected, Serial0/0/1
R2#
-----------------------------------------------------------------------------------------------------
EIGRP Default Route
The quad zero default static route can be used with any currently supported routing “ “ protocols. In
our example, we configure the static default route on R2 because it is simulating a connection to
ISP. Example 13-9 shows the default static route configuration on R2.
Configuring and Redistributing a Default Route in EIGRP
Loopback0 10.1.1.1 YES manual up up
R2(config)#ip route 0.0.0.0 0.0.0.0 loopback 0
R2(config)#router eigrp 1
R2(config-router)#redistribute static
R2(config-router)#^Z
R2#
The redistribute static command tells EIGRP to include this static route in its EIGRP updates to
other routers. Example 13-10 shows the routing table for R1 with the default route highlighted.
R3#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is 192.168.10.9 to network 0.0.0.0
172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
D 172.16.1.0/24 [90/540160] via 192.168.10.5, 00:14:46, Serial0/0/1
D 172.16.2.0/24 [90/540160] via 192.168.10.9, 00:14:47, Serial0/0/0
D 172.16.3.0/30 [90/2681856] via 192.168.10.9, 00:14:47, Serial0/0/0
[90/2681856] via 192.168.10.5, 00:14:46, Serial0/0/1
192.168.0.0/24 is variably subnetted, 2 subnets, 2 masks
D 192.168.0.0/22 is a summary, 00:15:27, Null0
C 192.168.0.0/24 is directly connected, Loopback0
192.168.1.0/29 is subnetted, 1 subnets
C 192.168.1.0 is directly connected, FastEthernet0/0
C 192.168.2.0/24 is directly connected, Loopback2
C 192.168.3.0/24 is directly connected, Loopback3
192.168.10.0/30 is subnetted, 2 subnets
C 192.168.10.4

is directly connected, Serial0/0/1
C 192.168.10.8 is directly connected, Serial0/0/0
D*EX 0.0.0.0/0 [170/1794304] via 192.168.10.9, 00:00:50, Serial0/0/0
R3#
Modifying the Bandwidth
R1(config)#interface serial 0/0/0
R1(config-if)#bandwidth 64
R2(config)#interface serial 0/0/0
R2(config-if)#bandwidth 64
R2(config-if)#interface serial 0/0/1
R2(config-if)#bandwidth 1024
R3(config)#interface serial 0/0/1
R3(config-if)#bandwidth 1024
Modifying the Hello Intervals and Hold Times
R1(config)#interface s0/0/0
R1(config-if)#ip hello-interval eigrp 1 60
R1(config-if)#ip hold-time eigrp 1 180
R2(config)#interface s0/0/0
R2(config-if)#ip hello-interval eigrp 1 60
R2(config-if)#ip hold-time eigrp 1 180
------------------------------------------------------
Verify EIGRP Configuration
R1#sh ip protocols
Routing Protocol is "eigrp 1 "
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Default networks flagged in outgoing updates
Default networks accepted from incoming updates
EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
EIGRP maximum hopcount 100
EIGRP maximum metric variance 1
Redistributing: eigrp 1
Automatic network summarization is not in effect
Maximum path: 4
Routing for Networks:
172.16.0.0
192.168.10.0
Routing Information Sources:
Gateway Distance Last Update
172.16.3.2 90 3925491
192.168.10.6 90 4485881
Distance: internal 90 external 170
R1#
R1#sh ip eigrp topology
IP-EIGRP Topology Table for AS 1
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - Reply status
P 172.16.1.0/24, 1 successors, FD is 28160
via Connected, FastEthernet0/0
P 172.16.3.0/30, 1 successors, FD is 2169856
via Connected, Serial0/0/0
P 192.168.10.4/30, 1 successors, FD is 513536
via Connected, Serial0/0/1
P 172.16.2.0/24, 1 successors, FD is 1052160
via 192.168.10.6 (1052160/540160), Serial0/0/1
via 172.16.3.2 (2172416/28160), Serial0/0/0
P 192.168.10.8/30, 1 successors, FD is 1026304
via 192.168.10.6 (1026304/514304), Serial0/0/1
via 172.16.3.2 (2681856/514304), Serial0/0/0
P 192.168.0.0/22, 1 successors, FD is 540160
via 192.168.10.6 (540160/28160), Serial0/0/1
P 0.0.0.0/0, 1 successors, FD is 2306304
via 192.168.10.6 (2306304/1794304), Serial0/0/1
via 172.16.3.2 (3449856/1280256), Serial0/0/0
R1#
R1#sh ip eigrp topology all-links
IP-EIGRP Topology Table for AS 1
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - Reply status
P 172.16.1.0/24, 1 successors, FD is 28160
via Connected, FastEthernet0/0
P 172.16.3.0/30, 1 successors, FD is 2169856
via Connected, Serial0/0/0
P 192.168.10.4/30, 1 successors, FD is 513536
via Connected, Serial0/0/1
P 172.16.2.0/24, 1 successors, FD is 1052160
via 192.168.10.6 (1052160/540160), Serial0/0/1
via 172.16.3.2 (2172416/28160), Serial0/0/0
P 192.168.10.8/30, 1 successors, FD is 1026304
via 192.168.10.6 (1026304/514304), Serial0/0/1
via 172.16.3.2 (2681856/514304), Serial0/0/0
P 192.168.0.0/22, 1 successors, FD is 540160
via 192.168.10.6 (540160/28160), Serial0/0/1
P 0.0.0.0/0, 1 successors, FD is 2306304
via 192.168.10.6 (2306304/1794304), Serial0/0/1
via 172.16.3.2 (3449856/1280256), Serial0/0/0
R1#
By comparing the output from Example 13-14 with the output from Example 13-15, you can see
that EIGRP has more routes in the routing table than shown initially. But these additional routes do
not meet the feasibility condition. Therefore, DUAL must first query neighbors to make sure there
is not a better route out there before installing a route that does not meet the feasibility
condition.
This is the essence of how DUAL avoids loops.
DUAL s finite state machine how the algorithm comes to a final decision is graphically “ “ “ represented
in the flow chart in Figure 13-6.
To monitor DUAL“s FSM in action, use the debug eigrp fsm command. Then shut down an interface
on the router to see how DUAL reacts to the change in the topology.