<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Networking Blog &#187; Cisco</title>
	<atom:link href="http://blog.webdir.bg/category/cisco-tutorials-howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.webdir.bg</link>
	<description>Networking - Cisco, Juniper, Linux</description>
	<lastBuildDate>Thu, 02 Feb 2012 21:09:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Cisco ME-3400G multicast routing</title>
		<link>http://blog.webdir.bg/cisco-me-3400g-multicast-routing/</link>
		<comments>http://blog.webdir.bg/cisco-me-3400g-multicast-routing/#comments</comments>
		<pubDate>Wed, 17 Nov 2010 15:58:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[multicast]]></category>
		<category><![CDATA[multicast routing]]></category>

		<guid isPermaLink="false">http://blog.webdir.bg/?p=405</guid>
		<description><![CDATA[Cisco ME-3400G working multicast routing.]]></description>
			<content:encoded><![CDATA[<p>First we need to allow multicast routing:</p>
<pre>ip multicast-routing distributed</pre>
<p>In our example we have two vlans:<br />
VLAN 3000 &#8211; clients that will receive multicast traffic<br />
VLAN 4000 &#8211; in this VLAN are sources of multicast traffic<br />
enter the following commands:</p>
<pre>ip igmp snooping querier
ip igmp snooping vlan 3000 mrouter learn cgmp
ip igmp snooping vlan 4000 mrouter learn cgmp</pre>
<p><span id="more-405"></span><br />
According Cisco&#8217;s official documentation: &#8220;A querier is a network device that sends query messages to discover which network devices are members of a given multicast group.&#8221;<br />
The next two lines configure VLAN 3000 and VLAN 4000 as multicast router port (static connection to a multicast router) and to learn sooping from CGMP (Cisco Group Management Protocol) self-join packets.<br />
Configuration of VLAN interfaces 3000 and 4000</p>
<pre>interface Vlan3000
 description multicast_client
 ip address 172.20.20.1 255.255.255.0
 ip pim dense-mode
!
interface Vlan4000
 description source_multicast
 ip address 150.158.231.111 255.255.0.0
 ip pim dense-mode
!</pre>
<p>You can read this article about <a href="http://www.netcraftsmen.net/resources/archived-articles/376-pim-dense-mode.html" target="_blank">pim dense-mode</a>.<br />
To view IGMP grops:</p>
<pre>sh ip igmp groups
226.168.20.44    Vlan3000                 5d04h     00:02:38  172.20.20.6
226.168.20.45    Vlan3000                 2d03h     00:02:35  172.20.20.6
226.168.20.46    Vlan3000                 1d14h     00:02:34  172.20.20.6
226.168.20.47    Vlan3000                 2d11h     00:02:41  172.20.20.6
226.168.20.49    Vlan3000                 00:58:13  00:02:38  172.20.20.9
226.168.20.48    Vlan3000                 1d14h     00:02:40  172.20.20.6
226.168.20.51    Vlan3000                 00:58:13  00:02:39  172.20.20.9
226.168.20.50    Vlan3000                 00:58:13  00:02:40  172.20.20.9
226.168.20.53    Vlan3000                 00:58:13  00:02:33  172.20.20.9
226.168.20.52    Vlan3000                 00:58:13  00:02:39  172.20.20.9
226.168.20.55    Vlan3000                 1d14h     00:02:41  172.20.20.6
226.168.20.54    Vlan3000                 00:58:13  00:02:35  172.20.20.9
226.168.20.57    Vlan3000                 1d14h     00:02:36  172.20.20.6</pre>
<p>To view membership</p>
<pre>multicast#sh ip igmp membership all
Flags: A  - aggregate, T - tracked
       L  - Local, S - static, V - virtual, R - Reported through v3
       I - v3lite, U - Urd, M - SSM (S,G) channel
       1,2,3 - The version of IGMP, the group is in
Channel/Group-Flags:
       / - Filtering entry (Exclude mode (S,G), Include mode (G))
Reporter:
        - last reporter if group is not explicitly tracked
       /      -  reporter in include mode,  reporter in exclude
 *,226.168.20.27                172.20.20.6     1d14h    02:37 2A     Vl3000
 *,226.168.20.26                172.20.20.6     1d14h    02:30 2A     Vl3000
 *,226.168.20.37                172.20.20.6     1d14h    02:32 2A     Vl3000
 *,226.168.20.40                172.20.20.6     2d03h    02:28 2A     Vl3000
 *,226.168.20.41                172.20.20.6     2d03h    02:31 2A     Vl3000
 *,226.168.20.43                172.20.20.6     1d14h    02:30 2A     Vl3000
 *,226.168.20.44                172.20.20.6     5d04h    02:34 2A     Vl3000
 *,226.168.20.45                172.20.20.6     2d03h    02:28 2A     Vl3000
 *,226.168.20.46                172.20.20.6     1d14h    02:34 2A     Vl3000
 *,226.168.20.47                172.20.20.6     2d11h    02:32 2A     Vl3000
 *,226.168.20.49                172.20.20.9     01:00:18 02:28 2A     Vl3000
 *,226.168.20.48                172.20.20.6     1d14h    02:33 2A     Vl3000
 *,226.168.20.51                172.20.20.9     01:00:18 02:29 2A     Vl3000
 *,226.168.20.50                172.20.20.9     01:00:18 02:35 2A     Vl3000
 *,226.168.20.53                172.20.20.9     01:00:18 02:31 2A     Vl3000</pre>
<p>To view snooping groups</p>
<pre>multicast#sh ip igmp snooping groups
Vlan      Group                    Type        Version     Port List
-----------------------------------------------------------------------
3000      226.168.1.1              igmp                    Gi0/6
3000      226.168.1.2              igmp                    Gi0/4
3000      226.168.1.3              igmp                    Gi0/4
3000      226.168.1.4              igmp                    Gi0/4
3000      226.168.1.6              igmp                    Gi0/6
3000      226.168.1.7              igmp                    Gi0/6
3000      226.168.1.9              igmp                    Gi0/6
3000      226.168.1.10             igmp                    Gi0/4
3000      226.168.1.12             igmp                    Gi0/4
3000      226.168.1.13             igmp                    Gi0/4
3000      226.168.1.14             igmp                    Gi0/4
3000      226.168.1.15             igmp                    Gi0/4
3000      226.168.1.16             igmp                    Gi0/4
3000      226.168.1.17             igmp                    Gi0/4
3000      226.168.1.18             igmp                    Gi0/4
3000      226.168.1.19             igmp                    Gi0/4
3000      226.168.1.22             igmp                    Gi0/6
3000      226.168.1.23             igmp                    Gi0/4
3000      226.168.1.24             igmp                    Gi0/4
3000      226.168.1.26             igmp                    Gi0/6
3000      226.168.1.28             igmp                    Gi0/6
3000      226.168.1.30             igmp                    Gi0/4</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.webdir.bg/cisco-me-3400g-multicast-routing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco ME3400 UNI/NNI Port Types</title>
		<link>http://blog.webdir.bg/cisco-me3400-uni-nni-port-types/</link>
		<comments>http://blog.webdir.bg/cisco-me3400-uni-nni-port-types/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 09:54:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cisco]]></category>

		<guid isPermaLink="false">http://blog.webdir.bg/?p=255</guid>
		<description><![CDATA[Cisco ME 3400 series switches are designed to meet the needs of Metro service providers. Introduce brand new concept and features to make the product easier to manage, deploy, and troubleshoot. One of new features is the new concept of UNI/NNI Port Types. UNI &#8211; User Network Interface NNI &#8211; Network Node Interface Based on [...]]]></description>
			<content:encoded><![CDATA[<p>Cisco ME 3400 series switches are designed to meet the needs of Metro service providers. Introduce brand new concept and features to make the product easier to manage, deploy, and troubleshoot. One of new features is the new concept of UNI/NNI Port Types.</p>
<ul>
<li>UNI &#8211; User Network Interface</li>
<li>NNI &#8211; Network Node Interface</li>
</ul>
<p>Based on the port type, certain features/behaviors are enabled or disabled to ease configuration, deployment, and troubleshooting.</p>
<p>UNI ports will not do local switching by default,  for example no local switching on UNI protects customers from each other ( host A dosn&#8217;t see host B ), and Control Plane Security  (CPS) is enabled, CPS protects against DoS attacks.</p>
<p>By default UNI ports:</p>
<ul>
<li><strong>not switching local traffic</strong>, for example no local switching on UNI protects customers from each  other ( host A dosn&#8217;t see host B ).</li>
<li>Control Plane Security  (CPS) is enabled, CPS protects against DoS  attacks.</li>
<li>using multiple UNI ports on the same ME 3400, up to 8 UNI ports <strong><a href="#wp1">can be configured to do local switching.</a></strong></li>
</ul>
<p>NNI ports:</p>
<ul>
<li>For ME 3400-24TS, by default, the 2 SFP ports are NNI port-type</li>
<li>For ME 3400G-12CS and ME 3400G-2CS, by default, the SFP-only ports are NNI port-type</li>
<li>There can be a maximum of <strong>4 ports defined as NNI ports</strong> (applicable to ME 3400-24TS and ME 3400G-12CS, all 4 ports can be configured as NNI on ME 3400G-2CS)<span id="more-255"></span></li>
</ul>
<p><strong>NOTE</strong>: In 12.2(25)SEG and later releases—Metro IP Access Image, all ports can be optionally configured as NNI (<strong>not limited to 4</strong>).</p>
<p><a class="thickbox" href="http://blog.webdir.bg/wp-content/uploads/2010/02/me3400.png"><img class="aligncenter size-full wp-image-260" title="me3400" src="http://blog.webdir.bg/wp-content/uploads/2010/02/me3400.png" alt="me3400" width="389" height="75" /></a></p>
<p>To configure port type:</p>
<pre>me3400#conf t
me3400(config)#int gi0/10
me3400(config-if)#port-type ?
  nni  Set port-type to NNI
  uni  Set port-type to UNI</pre>
<p style="text-align: center;"><a name="wp1"></a></p>
<h2 style="text-align: center;">Configuring UNI ports to do local switching (forwarding traffic between UNI ports)</h2>
<p>Port Fa0/3 and Fa0/4 on Cisco me3400 are UNI ports, belongs to VLAN 10, and Fa0/3 is not forwarding traffic to Fa0/4, and vice versa, but we wand to do local switching between them. Interface Fa0/1 is NNI. Configuration:</p>
<pre>me3400(config)#vlan 10
me3400(config-vlan)#uni-vlan community</pre>
<p>Configuration of ports:</p>
<pre>interface FastEthernet0/3
 switchport trunk allowed vlan 10
 switchport mode trunk
!
interface FastEthernet0/4
 switchport access vlan 10
!</pre>
<p>View VLAN configuration:</p>
<pre>me3400-test#sh vlan

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/2, Fa0/5, Fa0/6, Fa0/7
                                                Fa0/8, Fa0/9, Fa0/10, Fa0/11
                                                Fa0/12, Fa0/13, Fa0/14, Fa0/15
                                                Fa0/16, Fa0/17, Fa0/18, Fa0/19
                                                Fa0/20, Fa0/21, Fa0/22, Fa0/23
                                                Fa0/24, Gi0/1, Gi0/2
10   test1                           active    Fa0/4
20   test                             active
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        0      0
10   enet  100010     1500  -      -      -        -    -        0      0
20   enet  100020     1500  -      -      -        -    -        0      0
1002 fddi  101002     1500  -      -      -        -    -        0      0
1003 tr    101003     1500  -      -      -        -    -        0      0
1004 fdnet 101004     1500  -      -      -        ieee -        0      0
1005 trnet 101005     1500  -      -      -        ibm  -        0      0

Remote SPAN VLANs
------------------------------------------------------------------------------

Primary Secondary Type              Ports
------- --------- ----------------- ------------------------------------------

VLAN Type              Ports
---- ----------------- -------------------------------------------------------
10   UNI community     Fa0/1, Fa0/3, Fa0/4</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.webdir.bg/cisco-me3400-uni-nni-port-types/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ubuntu Linux and Cisco switch link aggregation (load balancing, bonding)</title>
		<link>http://blog.webdir.bg/ubuntu-linux-and-cisco-switch-link-aggregation-load-balancing-bonding/</link>
		<comments>http://blog.webdir.bg/ubuntu-linux-and-cisco-switch-link-aggregation-load-balancing-bonding/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 15:19:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[802.3ad]]></category>
		<category><![CDATA[bonding]]></category>
		<category><![CDATA[link aggregation]]></category>

		<guid isPermaLink="false">http://blog.webdir.bg/?p=201</guid>
		<description><![CDATA[Tutorial how to balance traffic between Cisco switch 3750 and Ubuntu linux with two NICs, using bonding and port channel interface.]]></description>
			<content:encoded><![CDATA[<p>Link aggregation between Cisco 3750 switch and Ubintu 9.10<br />
Ubuntu configuration:<br />
Install ifenslave — Attach and detach slave network devices to a bonding device.</p>
<pre>apt-get install  ifenslave</pre>
<p>Edit or create file /etc/modprobe.d/aliases.conf</p>
<pre>alias bond0 bonding
options bonding mode=4 miimon=100</pre>
<p>where mode 4 &#8211; IEEE 802.3ad Dynamic link aggregation. Creates aggregation groups that share the same speed and<br />
duplex settings. Utilizes all slaves in the active aggregator according to the 802.3ad specification.<br />
Edit /etc/network/interfaces.</p>
<pre>auto bond0
iface bond0 inet static
        address 192.168.200.5
        netmask 255.255.255.0
        network 192.168.200.0
        broadcast 192.168.200.255
        post-up ifenslave bond0 eth0 eth1
        gateway 192.168.200.1
        dns-nameservers 192.168.200.1
        dns-search example.com</pre>
<p><strong>UPDATE (02.01.2012): </strong>Ubuntu 11.10 (oneiric).</p>
<p><span id="more-201"></span></p>
<p>1.  Edit or create file /etc/modprobe.d/aliases.conf</p>
<pre>alias netdev-bond0 bonding
options bonding mode=4 miimon=100</pre>
<p>or</p>
<p>2. To run bonding first put module &#8220;bonding&#8221; in &#8220;/etc/modules&#8221; :</p>
<pre># /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
loop
lp
rtc
bonding</pre>
<p>In &#8220;/etc/network/interfaces&#8221;</p>
<pre>auto bond0
iface bond0 inet static
        slaves eth0 eth1
        bond_mode 4
        bond_miimon 100
        address 192.168.200.5
        netmask 255.255.255.0
        network 192.168.200.0
        broadcast 192.168.200.255
        post-up ifenslave bond0 eth0 eth1</pre>
<p>Cisco configuration ( Gi1/0/1 and Gi1/0/2 will be aggregated ):</p>
<pre>cisco-3750(config)#interface range GigabitEthernet 1/0/1, GigabitEthernet 1/0/2
cisco-3750(config-if-range)#switchport trunk encapsulation dot1q
cisco-3750(config-if-range)#switchport trunk allowed vlan 10,20
cisco-3750(config-if-range)#switchport mode trunk
cisco-3750(config-if-range)#<strong>channel-group 1 mode active</strong>
<strong>Creating a port-channel interface Port-channel 1</strong>
cisco-3750(config-if-range)#end
cisco-3750#</pre>
<p>Configuration of interface Port-Channel 1 must be exactly the same as Gi1/0/1 and Gi1/0/2.</p>
<pre>cisco-3750#sh ru int Po1
Building configuration...
Current configuration : 159 bytes
!
interface Port-channel1
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan 10,20
end</pre>
<p>If you want to modify configuration of aggregated interfaces, modify <strong>only configuration of Port-Channel</strong> interface.<br />
And the last step is to set <strong>load-balance</strong> algorithm:</p>
<pre>cisco-3750(config)#port-channel load-balance src-dst-ip
cisco-3750#sh etherchannel load-balance
EtherChannel Load-Balancing Operational State (src-dst-ip):
Non-IP: Source XOR Destination MAC address
  IPv4: Source XOR Destination IP address
  IPv6: Source XOR Destination IP address

cisco-3750#show etherchannel summary
Flags:  D - down        P - in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port

Number of channel-groups in use: 1
Number of aggregators:           1

Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(SU)         LACP      Gi1/0/1(P)  Gi1/0/2(P)

cisco-3750#
cisco-3750#show etherchannel protocol
                Channel-group listing:
                ----------------------
Group: 1
----------
Protocol:  LACP</pre>
<p>Traffic on Gi1/0/1</p>
<p style="text-align: center;"><a class="thickbox" href="http://blog.webdir.bg/wp-content/uploads/2010/01/gi1.png"><img class="size-full wp-image-233 aligncenter" title="gi1" src="http://blog.webdir.bg/wp-content/uploads/2010/01/gi1.png" alt="" width="603" height="242" /></a></p>
<p>Traffic on Gi1/0/2</p>
<p><a class="thickbox" href="http://blog.webdir.bg/wp-content/uploads/2010/01/gi2.png"><img class="aligncenter size-full wp-image-236" title="gi2" src="http://blog.webdir.bg/wp-content/uploads/2010/01/gi2.png" alt="" width="603" height="242" /></a></p>
<p>Traffic on Port-Channel1</p>
<p><a class="thickbox" href="http://blog.webdir.bg/wp-content/uploads/2010/01/po.png"><img class="aligncenter size-full wp-image-237" title="po" src="http://blog.webdir.bg/wp-content/uploads/2010/01/po.png" alt="" width="603" height="242" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.webdir.bg/ubuntu-linux-and-cisco-switch-link-aggregation-load-balancing-bonding/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cisco &#8220;gbic-invalid error detect&#8221;</title>
		<link>http://blog.webdir.bg/cisco-gbic-invalid-error-detect/</link>
		<comments>http://blog.webdir.bg/cisco-gbic-invalid-error-detect/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 12:57:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cisco]]></category>

		<guid isPermaLink="false">http://blog.webdir.bg/?p=189</guid>
		<description><![CDATA[Using third party SFP on Cisco switches. Cisco undocumented command - "service unsupported-transceiver"]]></description>
			<content:encoded><![CDATA[<p>After  putting SFP in GBIC, Cisco 3750 reports:</p>
<pre>%PM-4-ERR_DISABLE: gbic-invalid error detected on Gi0/2, putting Gi0/2 in err-disable state</pre>
<p>This can happen if you are using  third party SFP (non-cisco). The solution is to use undocumented command.<br />
First enter command:</p>
<pre>no errdisable detect cause gbic-invalid</pre>
<p>and second command:</p>
<pre>service unsupported-transceiver</pre>
<p>There is no autocomplete for this command and no guarantee, but try it &#8230; It works for me on Cisco 3750.<br /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.webdir.bg/cisco-gbic-invalid-error-detect/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>cisco backup configuration</title>
		<link>http://blog.webdir.bg/cisco-backup-configuration/</link>
		<comments>http://blog.webdir.bg/cisco-backup-configuration/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 09:28:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[backup config]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[snmp]]></category>

		<guid isPermaLink="false">http://blog.webdir.bg/?p=97</guid>
		<description><![CDATA[Detail tutorial how to automate backup of Cisco switch configuration, using MySQL, SNMP and PERL.]]></description>
			<content:encoded><![CDATA[<p>One simple method to backup Cisco&#8217;s configuration using SNMP and PERL. Download manually  from search.cpan.org  PERL library Cisco::CopyConfig  . Another way of installing:</p>
<pre>perl -MCPAN -e 'install Cisco::CopyConfig'</pre>
<p>Cisco::CopyConfig provides methods for manipulating the running-config of devices running IOS via SNMP directed TFTP. This module is essentially a wrapper for Net::SNMP and the CISCO-CONFIG-COPY-MIB-V1SMI.my MIB schema.<br />
It&#8217;s a good idea to store switch&#8217;s ip address ( if you have more switches ) in database like MySQL. The following perl script uses MySQL database. In MySQL database we store switch&#8217;s ip and snmp community.<br />
MySQL table:<span id="more-97"></span></p>
<pre> CREATE TABLE `sw_backup`.`switches` (
`id` BIGINT( 128 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`description` VARCHAR( 128 ) NOT NULL ,
`ip_address` VARCHAR( 128 ) NOT NULL ,
`community` VARCHAR( 128 ) NOT NULL
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_bin

insert into switches values('','core-switch','192.168.200.251','SNMPconfigCommunity1');
insert into switches values('','access-switch','192.168.200.252','SNMPconfigCommunity2');

mysql&gt; select * from switches;
+----+---------------+-----------------+----------------------+
| id | description   | ip_address      | community            |
+----+---------------+-----------------+----------------------+
|  1 | core-switch   | 192.168.200.251 | SNMPconfigCommunity1 |
|  2 | access-switch | 192.168.200.252 | SNMPconfigCommunity2 |
+----+---------------+-----------------+----------------------+
2 rows in set (0.00 sec)</pre>
<p>We need to istall TFTP server:</p>
<pre>on Debian: apt-get install atftp</pre>
<p>TFTP config file (/etc/default/atftpd):</p>
<pre>USE_INETD=true
OPTIONS="--tftpd-timeout 300 --retry-timeout 5  --maxthread 100 --verbose=5 /backup_switch"</pre>
<p>TFTP working directory is /backup_switch<br />
Configuring Cisco switch ( tested on C2960G, C3750G, 3400G ):<br />
A read-write SNMP community needs to be defined on each device, which allows the setting of parameters to copy or merge a running-config. Below is an example configuration that attempts to restrict read-write access to only the 192.168.200.10 (tftp server) host :</p>
<pre>access-list 70 remark tft-server-list
access-list 70 permit 192.168.200.10
access-list 70 deny   any</pre>
<p>SNMP configuration:</p>
<pre>snmp-server tftp-server-list 70
snmp-server view backup ciscoMgmt.96.1.1.1.1 included
snmp-server community SNMPconfigCommunity1 view backup RW 70</pre>
<p>Variables used in cisco backup script:<br />
/backup_switch &#8211; tftp root directory<br />
/storage/backup/daily/switches/ &#8211; backup directory<br />
Backup script:</p>
<pre class="brush: perl; title: ; notranslate">
#!/usr/bin/perl
use DBI;
use Cisco::CopyConfig;

my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)=localtime(time);
$year+=1900;
$mon  = sprintf(&quot;%02d&quot;,$mon+1);
$mday = sprintf(&quot;%02d&quot;,$mday);
$hour = sprintf(&quot;%02d&quot;,$hour);
$min  = sprintf(&quot;%02d&quot;,$min);
$sec  = sprintf(&quot;%02d&quot;,$sec);
$date_format=&quot;$mday.$mon.$year&quot;;

$sql=&quot;select ip_address,community,description from switches order by inet_aton(ip_address) asc&quot;;
$dbh = DBI-&gt;connect(&quot;dbi:mysql:sw_backup:xxx.xxx.xxx.xxx&quot;,&quot;username&quot;,&quot;password&quot;) or die &quot;Can't connect to MySQL: $DBI::errstr\n&quot;;
$sth = $dbh-&gt;prepare($sql);
$sth-&gt;execute();

$tftp_address   = '192.168.200.10';

while (@row=$sth-&gt;fetchrow_array) {
 $config     = Cisco::CopyConfig-&gt;new(
 Host =&gt; $row[0],   # host
 Comm =&gt; $row[1], # community
 Tmout =&gt; '10',       # timeout
 Retry =&gt; '2'           # retry
 );

 $tftp_file = &quot;$row[2].$date_format.conf&quot;;

 if ($config-&gt;copy($tftp_address, $tftp_file) ) {
 print &quot;OK -&gt; switch ip: $row[0], file: $tftp_file\n&quot;; }
 else {
 print &quot;ERROR -&gt; switch ip: $row[0], no backup file\n&quot;;
 }

}

system(&quot;mkdir /storage/backup/daily/switches/$date_format&quot;);
system(&quot;cp /backup_switch/cisco-* /storage/backup/daily/switches/$date_format&quot;);
</pre>
<p>Result:</p>
<pre>sns ~ # perl cisco-backup.pl
OK -&gt; switch ip: 192.168.200.251, file: core-switch.19.01.2010.conf
OK -&gt; switch ip: 192.168.200.252, file: access-switch.19.01.2010.conf

sns ~ # tail -n 100 /var/log/syslog | grep tftp
Jan 19 15:56:53 sns atftpd[7848]: Fetching from 192.168.200.251 to core-switch.19.01.2010.conf
Jan 19 15:56:55 sns atftpd[7848]: Fetching from 192.168.200.252 to access-switch.19.01.2010.conf</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.webdir.bg/cisco-backup-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cisco 1800 configure tagged vlan on WAN interface</title>
		<link>http://blog.webdir.bg/cisco-1800-configure-tagged-vlan-on-wan-interface/</link>
		<comments>http://blog.webdir.bg/cisco-1800-configure-tagged-vlan-on-wan-interface/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 15:12:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[dot1.q]]></category>
		<category><![CDATA[tagged vlan]]></category>
		<category><![CDATA[vlan]]></category>

		<guid isPermaLink="false">http://blog.webdir.bg/?p=75</guid>
		<description><![CDATA[A brief tutorial how to configure dot.1q ( tagged vlan )  Layer3 interface on Cisco 1800 series. ( on WAN interface ).  ]]></description>
			<content:encoded><![CDATA[<p>A brief tutorial how to configure dot.1q ( tagged vlan )  Layer3 interface on Cisco 1800 series. ( on WAN interface ).  First will create vlan 777 in vlan database</p>
<pre>cisco1800#vlan database
cisco1800(vlan)vlan 777
VLAN 777 added:
    Name: VLAN0777
cisco1800(vlan)#
cisco1800(vlan)#vlan 777 name dot1q_vlan_on_WAN_interface
VLAN 777 modified:
    Name: dot1q_vlan_on_WAN_interface</pre>
<p>Now verify vlan:</p>
<pre>cisco1800#show vlan-switch

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa4
2    Servers                          active    Fa1, Fa2
3    SERVICE                          active    Fa3
5    VLAN0005                         active
99   VLAN0099                         active
777  dot1q_vlan_on_WAN_interface      active
1002 fddi-default                     active
1003 token-ring-default               active
1004 fddinet-default                  active
1005 trnet-default                    active</pre>
<p>The last step is to create the tagged subinterface  on FastEthernet0:<span id="more-75"></span></p>
<pre>cisco1800(config)#interface FastEthernet 0.777</pre>
<p>After the interface number just enter &#8220;.&#8221; (dot ) and vlan id.</p>
<pre>cisco1800(config-subif)#encapsulation dot1Q 777
cisco1800(config-subif)#ip address xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx</pre>
<p>View configuration:</p>
<pre>cisco1800#sh ru interface FastEthernet 0.777
interface FastEthernet0.777
 encapsulation dot1Q 100
 ip address xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx
 no snmp trap link-status</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.webdir.bg/cisco-1800-configure-tagged-vlan-on-wan-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ToS to DSCP mapping</title>
		<link>http://blog.webdir.bg/tos-to-dscp-mapping/</link>
		<comments>http://blog.webdir.bg/tos-to-dscp-mapping/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 21:24:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[dscp]]></category>
		<category><![CDATA[tos]]></category>
		<category><![CDATA[tos to dscp mapping]]></category>

		<guid isPermaLink="false">http://blog.webdir.bg/?p=35</guid>
		<description><![CDATA[Table of ToS to DSCP mapping (conversion).]]></description>
			<content:encoded><![CDATA[<p>Table of ToS to DSCP mapping (conversion).</p>
<p>Related articles:<br />
<a href="http://blog.webdir.bg/cisco-rewrite-dscp-tos-values/" target="_self">Configuration of Cisco switch to rewrite ToS (DSCP)</a></p>
<p><span id="more-35"></span></p>
<table style="font-size: 12px;" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<th>ToS<br />
dec</th>
<th>ToS hex</th>
<th>ToS bin</th>
<th>ToS Prec. (bin)</th>
<th>ToS Prec. (dec)</th>
<th>ToS Delay Flag</th>
<th>ToS Throgh-<br />
put Flag</th>
<th>ToS Relia-<br />
bility FLag</th>
<th>DSCP bin</th>
<th>DSCP hex</th>
<th>DSCP dec</th>
<th>DSCP Class</th>
</tr>
<tr>
<td>0</td>
<td>0&#215;00</td>
<td>00000000</td>
<td>000</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>000000</td>
<td>0&#215;00</td>
<td>0</td>
<td>none</td>
</tr>
<tr class="even">
<td>32</td>
<td>0&#215;20</td>
<td>00100000</td>
<td>001</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>001000</td>
<td>0&#215;08</td>
<td>8</td>
<td>cs1</td>
</tr>
<tr>
<td>40</td>
<td>0&#215;28</td>
<td>00101000</td>
<td>001</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>001010</td>
<td>0x0A</td>
<td>10</td>
<td>af11</td>
</tr>
<tr class="even">
<td>48</td>
<td>0&#215;30</td>
<td>00110000</td>
<td>001</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>001100</td>
<td>0x0C</td>
<td>12</td>
<td>af12</td>
</tr>
<tr>
<td>56</td>
<td>0&#215;38</td>
<td>00111000</td>
<td>001</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>001110</td>
<td>0x0E</td>
<td>14</td>
<td>af13</td>
</tr>
<tr class="even">
<td>64</td>
<td>0&#215;40</td>
<td>01000000</td>
<td>010</td>
<td>2</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>010000</td>
<td>0&#215;10</td>
<td>16</td>
<td>cs2</td>
</tr>
<tr>
<td>72</td>
<td>0&#215;48</td>
<td>01001000</td>
<td>010</td>
<td>2</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>010010</td>
<td>0&#215;12</td>
<td>18</td>
<td>af21</td>
</tr>
<tr class="even">
<td>80</td>
<td>0&#215;50</td>
<td>01010000</td>
<td>010</td>
<td>2</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>010100</td>
<td>0&#215;14</td>
<td>20</td>
<td>af22</td>
</tr>
<tr>
<td>88</td>
<td>0&#215;58</td>
<td>01011000</td>
<td>010</td>
<td>2</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>010110</td>
<td>0&#215;16</td>
<td>22</td>
<td>af23</td>
</tr>
<tr class="even">
<td>96</td>
<td>0&#215;60</td>
<td>01100000</td>
<td>011</td>
<td>3</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>011000</td>
<td>0&#215;18</td>
<td>24</td>
<td>cs3</td>
</tr>
<tr>
<td>104</td>
<td>0&#215;68</td>
<td>01101000</td>
<td>011</td>
<td>3</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>011010</td>
<td>0x1A</td>
<td>26</td>
<td>af31</td>
</tr>
<tr class="even">
<td>112</td>
<td>0&#215;70</td>
<td>01110000</td>
<td>011</td>
<td>3</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>011100</td>
<td>0x1C</td>
<td>28</td>
<td>af32</td>
</tr>
<tr>
<td>120</td>
<td>0&#215;78</td>
<td>01111000</td>
<td>011</td>
<td>3</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>011110</td>
<td>0x1E</td>
<td>30</td>
<td>af33</td>
</tr>
<tr class="even">
<td>128</td>
<td>0&#215;80</td>
<td>10000000</td>
<td>100</td>
<td>4</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>100000</td>
<td>0&#215;20</td>
<td>32</td>
<td>cs4</td>
</tr>
<tr>
<td>136</td>
<td>0&#215;88</td>
<td>10001000</td>
<td>100</td>
<td>4</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>100010</td>
<td>0&#215;22</td>
<td>34</td>
<td>af41</td>
</tr>
<tr class="even">
<td>144</td>
<td>0&#215;90</td>
<td>10010000</td>
<td>100</td>
<td>4</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>100100</td>
<td>0&#215;24</td>
<td>36</td>
<td>af42</td>
</tr>
<tr>
<td>152</td>
<td>0&#215;98</td>
<td>10011000</td>
<td>100</td>
<td>4</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>100110</td>
<td>0&#215;26</td>
<td>38</td>
<td>af43</td>
</tr>
<tr class="even">
<td>160</td>
<td>0xA0</td>
<td>10100000</td>
<td>101</td>
<td>5</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>101000</td>
<td>0&#215;28</td>
<td>40</td>
<td>cs5</td>
</tr>
<tr>
<td>184</td>
<td>0xB8</td>
<td>10111000</td>
<td>101</td>
<td>5</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>101110</td>
<td>0x2E</td>
<td>46</td>
<td>ef</td>
</tr>
<tr class="even">
<td>192</td>
<td>0xC0</td>
<td>11000000</td>
<td>110</td>
<td>6</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>110000</td>
<td>0&#215;30</td>
<td>48</td>
<td>cs6</td>
</tr>
<tr>
<td>224</td>
<td>0xE0</td>
<td>11100000</td>
<td>111</td>
<td>7</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>111000</td>
<td>0&#215;38</td>
<td>56</td>
<td>cs7</td>
</tr>
</tbody>
</table>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.webdir.bg/tos-to-dscp-mapping/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Cisco &#8211; rewrite DSCP (ToS) values</title>
		<link>http://blog.webdir.bg/cisco-rewrite-dscp-tos-values/</link>
		<comments>http://blog.webdir.bg/cisco-rewrite-dscp-tos-values/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 13:44:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[dscp]]></category>
		<category><![CDATA[rewrite dscp]]></category>
		<category><![CDATA[rewrite tos]]></category>
		<category><![CDATA[set dscp]]></category>
		<category><![CDATA[set dspc]]></category>
		<category><![CDATA[set tos]]></category>
		<category><![CDATA[tos]]></category>

		<guid isPermaLink="false">http://blog.webdir.bg/?p=5</guid>
		<description><![CDATA[Detailed tutorial how to rewrite DSCP (ToS) values on Cisco 3750 switch.]]></description>
			<content:encoded><![CDATA[<p>Rewriting DSCP (ToS) values    is tested on Cisco switch 3750:</p>
<pre>Ports  	   	Model  	   	    SW Version  	  SW Image
------ 	  	------ 	  	    ----------------- 	  ------------
52 	        WS-C3750G-48TS      12.2(25)SEE4 	  C3750-ADVIPSERVICESK</pre>
<p>By default QoS configuration is disabled:</p>
<pre>sw3750#sh mls qos
QoS is disabled
QoS ip packet dscp rewrite is enabled</pre>
<p>So we need to enable QoS:<br />
<span id="more-5"></span></p>
<pre>sw3750#conf t
sw3750(config)#mls qos
sw3750(config)#end

sw3750#sh mls qos
QoS is enabled
QoS ip packet dscp rewrite is enabled</pre>
<p>We need to create access list:</p>
<pre>sw3750#conf t
sw3750(config)#access-list 1 remark rewrite_dscp
sw3750(config)#access-list 1 permit any

sw3750#show access-lists 1
Standard IP access list 1
  10 permit any</pre>
<p>Now we&#8217;ll begin with real QoS, and use terms as &#8220;<strong>class map</strong>&#8221; and &#8220;<strong>policy map</strong>&#8220;. According Cisco&#8217;s official documentation:</p>
<p>A <strong>class map</strong> is a mechanism that you use to name a specific traffic flow (or class) and to isolate it from all other traffic. The class map defines the criteria used to match against a specific traffic flow to further classify it. The criteria can include matching the access group defined by the ACL or matching a specific list of DSCP or IP precedence values. If you have more than one type of traffic that you want to classify, you can create another class map and use a different name. After a packet is matched against the<br />
class-map criteria, you further classify it through the use of a policy map.</p>
<p>A <strong>policy map</strong> specifies which traffic class to act on. Actions can include trusting the CoS, DSCP, or IP precedence values in the traffic class; setting a specific DSCP or IP precedence value in the traffic class; or specifying the traffic bandwidth limitations and the action to take when the traffic is out of profile. Before a policy map can be effective, you must attach it to a port.</p>
<pre>sw3750(config)#class-map ?
   WORD class-map name
   match-all Logical-AND all matching statements under this classmap
   match-any Logical-OR all matching statements under this classmap
sw3750(config)#class-map match-all class-map-dscp
sw3750(config-cmap)#match access-group 1

sw3750#show class-map class-map-dscp
 Class Map match-all class-map-dscp (id 1)
   Match access-group 1</pre>
<p>After creting class-map, we need policy map. In this policy map we&#8217;ll rewrite dscp value of packet: &#8220;set dscp af32&#8243; , this is ToS 0&#215;70</p>
<pre>sw3750(config)#policy-map vlan101
sw3750(config-pmap)#class class-map-dscp
sw3750(config-pmap-c)#set dscp af32

sw3750#sh policy-map vlan101
 Policy Map vlan101
  Class class-map-dscp
   set dscp af32</pre>
<p>OK, we created calss map and policy map, and now we&#8217;ll aplly them to interface.</p>
<pre>sw3750(config)#int vlan101
sw3750(config-if)#service-policy input vlan101

sw3750#sh ru int vlan101
interface Vlan101
  no ip address
  service-policy input vlan101
end</pre>
<p>On a trunk port apply next commands:</p>
<pre>sw3750(config)#int gi1/0/4
sw3750(config-if)#mls qos vlan-based

sw3750#sh ru int gi1/0/4
  interface GigabitEthernet1/0/4
  switchport trunk encapsulation dot1q
  switchport trunk allowed 101
  switchport mode trunk
  mls qos vlan-based
end</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.webdir.bg/cisco-rewrite-dscp-tos-values/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

