<?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>IPCPU——网络之路 &#187; 配置</title>
	<atom:link href="http://www.ipcpu.com/tag/%e9%85%8d%e7%bd%ae/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ipcpu.com</link>
	<description></description>
	<lastBuildDate>Fri, 10 Feb 2012 15:05:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>linux下基于ipables的NAT的配置</title>
		<link>http://www.ipcpu.com/2010/06/linux-nat-iptables/</link>
		<comments>http://www.ipcpu.com/2010/06/linux-nat-iptables/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 05:49:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[网络技术]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[NAT]]></category>
		<category><![CDATA[架设]]></category>
		<category><![CDATA[配置]]></category>

		<guid isPermaLink="false">http://www.ipcpu.com/?p=556</guid>
		<description><![CDATA[iptables 是一个状态包检测防火墙stateful packet inspection。 实际上由netfilter和iptables两个组件构成。netfilter是集成在内核中的一部分，其作用是定义、保存相应的规则，而iptables是一种工具，用来修改信息的过滤规则及其他配置。 netfilter是Linux核心中的一个通用架构，其提供了一系列的表（tables）,每个表由若干个链（chains）组成，而每条链可以由一条或若干条规则（rules）组成。 详细的可以参见  参考资料 1  2 环境：linux .winxp两台 Linux eth2:ip:10.1.10.251  接外网 linux eth1:ip:6.6.6.6    接内网（winxp） 1、配置默认策略 开启转发：修改/etc/sysctl.conf的net.ipv4.ip_forward=1 #不要修改/proc/sys/net/ipv4/ip_forward重启不保存 iptables -F：清空所选链中的规则，如果没有指定链则清空指定表中所有链的规则 iptables -X：清除预设表filter中使用者自定链中的规则 iptables -Z：清除预设表filter中使用者自定链中的规则 iptables -P INPUT DROP iptables -P FORWARD DROP 2.允许环回 iptables -A INPUT -i lo -j ACCEPT 3.连接状态设置 iptables -A INPUT -m state &#8211;state ESTABLISHED,RELATED -j ACCEPT iptables -A [...]]]></description>
			<content:encoded><![CDATA[<p>iptables 是一个状态包检测防火墙stateful packet inspection。</p>
<p>实际上由netfilter和iptables两个组件构成。netfilter是集成在内核中的一部分，其作用是定义、保存相应的规则，而iptables是一种工具，用来修改信息的过滤规则及其他配置。</p>
<p>netfilter是Linux核心中的一个通用架构，其提供了一系列的表（tables）,每个表由若干个链（chains）组成，而每条链可以由一条或若干条规则（rules）组成。</p>
<p>详细的可以参见  参考资料 1  2</p>
<p>环境：linux .winxp两台<br />
Linux eth2:ip:10.1.10.251  接外网</p>
<p>linux eth1:ip:6.6.6.6    接内网（winxp）</p>
<p>1、配置默认策略</p>
<p>开启转发：修改/etc/sysctl.conf的net.ipv4.ip_forward=1<br />
#不要修改/proc/sys/net/ipv4/ip_forward重启不保存</p>
<p>iptables -F：清空所选链中的规则，如果没有指定链则清空指定表中所有链的规则<br />
iptables -X：清除预设表filter中使用者自定链中的规则<br />
iptables -Z：清除预设表filter中使用者自定链中的规则</p>
<p>iptables -P INPUT DROP<br />
iptables -P FORWARD DROP</p>
<p>2.允许环回</p>
<p>iptables -A INPUT -i lo -j ACCEPT</p>
<p>3.连接状态设置<span id="more-556"></span></p>
<p>iptables -A INPUT -m state &#8211;state ESTABLISHED,RELATED -j ACCEPT<br />
iptables -A FORWARD -m state &#8211;state ESTABLISHED,RELATED -j ACCEPT</p>
<p>4.实施NAT</p>
<p>iptables -t nat -A POSTROUTING -j MASQUERADE<br />
#此设置比较危险，推荐按照入接口，源地址，出接口进行NAT<br />
#该设置会使所有接口都成为NAT入接口包括eth2</p>
<p>5.允许内部上网</p>
<p>iptables -A FORWARD -p tcp &#8211;dport 80 -j ACCEPT<br />
iptables -A FORWARD -p tcp &#8211;dport 53 -j ACCEPT<br />
iptables -A FORWARD -p udp &#8211;dport 53 -j ACCEPT</p>
<p>6.保存<br />
iptables-save或service iptables save<br />
7.测试，ok，QQ能上，网页能上<br />
参考资料：<br />
1.http://redking.blog.51cto.com/27212/143185<br />
2.http://linux.vbird.org/linux_server/0250simple_firewall.php</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ipcpu.com/2010/06/linux-nat-iptables/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Cisco PVLAN的配置</title>
		<link>http://www.ipcpu.com/2010/05/cisco-pvlan/</link>
		<comments>http://www.ipcpu.com/2010/05/cisco-pvlan/#comments</comments>
		<pubDate>Sun, 09 May 2010 10:05:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[网络技术]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[pVLAN]]></category>
		<category><![CDATA[端口隔离]]></category>
		<category><![CDATA[配置]]></category>

		<guid isPermaLink="false">http://www.ipcpu.com/?p=532</guid>
		<description><![CDATA[PVLAN即私有VLAN（Private VLAN），PVLAN采用两层VLAN隔离技术，只有上层VLAN全局可见，下层VLAN相互隔离。 每个pVLAN 包含2种VLAN ：主VLAN（primary VLAN）和辅助VLAN（Secondary VLAN）。辅助VLAN（Secondary VLAN）包含两种类型：隔离VLAN（isolated VLAN）和团体VLAN（community VLAN）。 pVLAN中的两种接口类型：处在pVLAN中的交换机物理端口，有两种接口类型。 ①混杂端口（Promiscuous Port） ②主机端口（Host Port） Catalyst3560， 45，    65系列支持  配置pVLAN的实例：       SwitchA(config)#vlan 100       SwitchA(config-vlan)#private-vlan primary                                  !设置主VLAN 100                      SwitchA(config)#vlan 200       SwitchA(config-vlan)#private-vlan community       !设置团体VLAN 200                                           SwitchA(config)#vlan 300       SwitchA(config-vlan)#private-vlan isolated       !设置隔离VLAN 300                                                SwitchA(config)#vlan 100       SwitchA(config-vlan)#private-vlan association 200,300        [...]]]></description>
			<content:encoded><![CDATA[<p>PVLAN即私有VLAN（Private VLAN），PVLAN采用两层VLAN隔离技术，只有上层VLAN全局可见，下层VLAN相互隔离。</p>
<p>每个pVLAN 包含2种VLAN ：主VLAN（primary VLAN）和辅助VLAN（Secondary VLAN）。辅助VLAN（Secondary VLAN）包含两种类型：隔离VLAN（isolated VLAN）和团体VLAN（community VLAN）。<br />
pVLAN中的两种接口类型：处在pVLAN中的交换机物理端口，有两种接口类型。<br />
①混杂端口（Promiscuous Port）<br />
②主机端口（Host Port）<br />
<strong><br />
Catalyst3560， 45，    65系列支持</strong></p>
<p><strong> 配置pVLAN的实例：</strong><br />
     <span style="color: #008000;"> SwitchA(config)#vlan 100<br />
      SwitchA(config-vlan)#private-vlan primary                           <br />
      !设置主VLAN 100<br />
              <br />
      SwitchA(config)#vlan 200<br />
      SwitchA(config-vlan)#private-vlan community <br />
     !设置团体VLAN 200                                    </span></p>
<p>      SwitchA(config)#vlan 300<br />
      SwitchA(config-vlan)#private-vlan isolated <br />
     !设置隔离VLAN 300                                         </p>
<p>      SwitchA(config)#vlan 100<br />
      SwitchA(config-vlan)#private-vlan association 200,300  <br />
      !将辅助VLAN关联到主VLAN                       </p>
<p><span style="color: #008000;">     <span id="more-532"></span><br />
      SwitchA(config)#interface vlan 100<br />
      SwitchA(config-if)#private-vlan mapping add 200,300                 <br />
      !将辅助VLAN映射到主VLAN接口，允许pVLAN入口流量的三层交换     <br />
     <br />
      SwitchA(config)# interface fastethernet 0/2<br />
      SwitchA(config-if)#switchport mode private-vlan host<br />
      SwitchA(config-if)#switchport private-vlan host-association 100 200<br />
      !2号口划入团体VLAN 200</span></p>
<p>      SwitchA(config)# interface fastethernet 0/3<br />
      SwitchA(config-if)#switchport mode private-vlan host<br />
      SwitchA(config-if)#switchport private-vlan host-association 100 300<br />
      !3号口划入隔离VLAN 300</p>
<p>      SwitchA(config)# interface fastethernet 0/1<br />
      SwitchA(config-if)#switchport mode private-vlan promiscuous<br />
      SwitchA(config-if)#switchport private-vlan mapping 100 add 200-300<br />
      !1号口杂合模式</p>
<p><strong>CatOS的配置</strong><br />
  <span style="color: #008000;">    set vlan 100 pvlan-type primary<br />
      set vlan 200 pvlan-type community     <br />
      set vlan 300 pvlan-type isolated     <br />
      set pvlan 100 200 5/1<br />
      set pvlan 100 300 5/2<br />
      set pvlan mapping 100,200 15/1<br />
      set pvlan mapping 100,300 15/1    //指定混杂模式的接口</span></p>
<p><strong>参考资料：<br />
</strong><a href="http://hi.baidu.com/n6630/blog/item/c6e6974cb3d362fdd62afc64.html">http://hi.baidu.com/n6630/blog/item/c6e6974cb3d362fdd62afc64.html</a><br />
<a href="http://yixuelian.blog.51cto.com/133058/56824">http://yixuelian.blog.51cto.com/133058/56824</a><br />
<a href="http://hi.baidu.com/coghost/blog/item/4f4dfb22e3bdd5a24723e83e.html">http://hi.baidu.com/coghost/blog/item/4f4dfb22e3bdd5a24723e83e.html</a><br />
<a href="http://baike.baidu.com/view/1065646.htm">http://baike.baidu.com/view/1065646.htm</a><br />
<strong>关于端口隔离</strong></p>
<p><span style="color: #008000;">Switch(config)# interface gigabitethernet1/0/2<br />
Switch(config-if)# switchport protected</span></p>
<p>Catalyst 29 35系列支持<br />
网关 及共享口 不敲protected 即可通信</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ipcpu.com/2010/05/cisco-pvlan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>二层的EtherChannel和三层的EtherChannel</title>
		<link>http://www.ipcpu.com/2010/05/enterchannel-l-2-3/</link>
		<comments>http://www.ipcpu.com/2010/05/enterchannel-l-2-3/#comments</comments>
		<pubDate>Sat, 08 May 2010 02:55:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[网络技术]]></category>
		<category><![CDATA[3550]]></category>
		<category><![CDATA[CCNP]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[EtherChannel]]></category>
		<category><![CDATA[交换机]]></category>
		<category><![CDATA[配置]]></category>

		<guid isPermaLink="false">http://www.ipcpu.com/?p=524</guid>
		<description><![CDATA[二层EtherChannel配置： Switch(config)#int range f0/1 &#8211; 2 Switch(config-if-range)#channel-group 1 mode active Switch(config)#int port-channel 1 Switch(config-if)#switchport mode trunk 物理口会自动继承逻辑口上的配置 interface FastEthernet0/1 channel-group 1 mode active switchport mode trunk 注意事项： 3550上可能会出Command rejected（Packet Tracer5.3也是如此）要先封装协议，再起trunk。 Switch(config)#int f0/5 Switch(config-if)#switchport mode trunk Command rejected: An interface whose trunk encapsulation is &#8220;Auto&#8221; can not be configured to &#8220;trunk&#8221; mode. Switch(config-if)#switchport trunk encapsulation dot1q [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ipcpu.com/wp-content/uploads/2010/05/etherchannel_r1_c1.jpg"><img class="alignnone size-full wp-image-530" title="etherchannel_r1_c1" src="http://www.ipcpu.com/wp-content/uploads/2010/05/etherchannel_r1_c1.jpg" alt="" width="461" height="279" /></a></p>
<p><strong>二层EtherChannel配置：</strong></p>
<p>Switch(config)#int range f0/1 &#8211; 2</p>
<p>Switch(config-if-range)#channel-group 1 mode active</p>
<p>Switch(config)#int port-channel 1</p>
<p>Switch(config-if)#switchport mode trunk</p>
<p>物理口会自动继承逻辑口上的配置</p>
<p>interface FastEthernet0/1<br />
channel-group 1 mode active<br />
switchport mode trunk<span id="more-524"></span></p>
<p><span style="color: #339966;">注意事项：</span><br />
3550上可能会出Command rejected（Packet Tracer5.3也是如此）要先封装协议，再起trunk。</p>
<p>Switch(config)#int f0/5<br />
Switch(config-if)#switchport mode trunk<br />
Command rejected: An interface whose trunk encapsulation is &#8220;Auto&#8221; can not be configured to &#8220;trunk&#8221; mode.</p>
<p>Switch(config-if)#switchport trunk encapsulation dot1q<br />
Switch(config-if)#switchport mode trunk</p>
<p><strong>三层EtherChannel配置：</strong></p>
<p>interface range FastEthernet0/1 &#8211; 3<br />
shutdown<br />
no switchport<br />
channel-group 1 mode active</p>
<p>interface Port-channel 1<br />
no switchport<br />
ip address 192.168.0.1 255.255.255.252</p>
<p>interface range FastEthernet0/1 &#8211; 3<br />
no shutdown</p>
<p><span style="color: #339966;">注意事项：</span><br />
shutdown 可以不用，但会弹出很多接口信息<br />
Packet Tracer 5.3做实验时，range可能配不了channel-group单个接口进入配置即可。</p>
<p><span style="color: #339966;">删掉EtherChannel</span></p>
<p>no int po 1<br />
default f0/1 &#8211; 3</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ipcpu.com/2010/05/enterchannel-l-2-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>H3C MP(multilink ppp)的配置</title>
		<link>http://www.ipcpu.com/2010/05/h3c-mppp/</link>
		<comments>http://www.ipcpu.com/2010/05/h3c-mppp/#comments</comments>
		<pubDate>Fri, 07 May 2010 13:07:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[网络技术]]></category>
		<category><![CDATA[H3C]]></category>
		<category><![CDATA[H3CNE]]></category>
		<category><![CDATA[MP]]></category>
		<category><![CDATA[MPPP]]></category>
		<category><![CDATA[multilink ppp]]></category>
		<category><![CDATA[PPP]]></category>
		<category><![CDATA[华为]]></category>
		<category><![CDATA[配置]]></category>

		<guid isPermaLink="false">http://www.ipcpu.com/?p=512</guid>
		<description><![CDATA[将物理接口与虚拟模板接口关联 [RTA] interface virtual-template 1 [RTA-Virtual-Template1] ip address 1.1.1.1 24 [RTA] interface serial 2/0 [RTA-Serial2/0] ppp mp virtual-template 1 [RTA] interface serial 2/1 [RTA-Serial2/0] ppp mp virtual-template 1 [RTB] interface virtual-template 1 [RTB-Virtual-Template1] ip address 1.1.1.2 24 [RTB] interface serial 2/0 [RTB-Serial2/0] ppp mp virtual-template 1 [RTB] interface serial 2/1 [RTB-Serial2/0] ppp mp virtual-template 1 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ipcpu.com/wp-content/uploads/2010/05/h3c_mp001_r1_c1.jpg"><img class="alignnone size-full wp-image-518" title="h3c_mp001_r1_c1" src="http://www.ipcpu.com/wp-content/uploads/2010/05/h3c_mp001_r1_c1.jpg" alt="" width="400" height="307" /></a><a href="http://www.ipcpu.com/wp-content/uploads/2010/05/h3c_mp002_r1_c1.jpg"><img class="alignnone size-full wp-image-519" title="h3c_mp002_r1_c1" src="http://www.ipcpu.com/wp-content/uploads/2010/05/h3c_mp002_r1_c1.jpg" alt="" width="400" height="308" /></a><img title="More..." src="http://www.ipcpu.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /><img title="More..." src="http://www.ipcpu.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /><span id="more-512"></span></p>
<p><a href="http://www.ipcpu.com/wp-content/uploads/2010/05/h3c_mp003_r1_c11.jpg"><img class="alignnone size-full wp-image-521" title="h3c_mp003_r1_c1" src="http://www.ipcpu.com/wp-content/uploads/2010/05/h3c_mp003_r1_c11.jpg" alt="" width="480" height="372" /></a></p>
<p><a href="http://www.ipcpu.com/wp-content/uploads/2010/05/h3cmp_r1_c1.jpg"></a></p>
<p><a href="http://www.ipcpu.com/wp-content/uploads/2010/05/h3c_mp2_r1_c1.jpg"></a></p>
<p><strong>将物理接口与虚拟模板接口关联</strong></p>
<p>[RTA] interface virtual-template 1<br />
[RTA-Virtual-Template1] ip address 1.1.1.1 24<br />
[RTA] interface serial 2/0<br />
[RTA-Serial2/0] ppp mp virtual-template 1<br />
[RTA] interface serial 2/1<br />
[RTA-Serial2/0] ppp mp virtual-template 1</p>
<p>[RTB] interface virtual-template 1<br />
[RTB-Virtual-Template1] ip address 1.1.1.2 24<br />
[RTB] interface serial 2/0<br />
[RTB-Serial2/0] ppp mp virtual-template 1<br />
[RTB] interface serial 2/1<br />
[RTB-Serial2/0] ppp mp virtual-template 1<br />
<strong>MP-Group方式配置（拓扑图同上）</strong><br />
RTA] interface mp-group 1<br />
[RTA-Mp-group1] ip address 1.1.1.1 24<br />
[RTA-Mp-group1] interface Serial2/0<br />
[RTA-Serial2/0] ppp mp mp-group 1<br />
[RTA-Mp-group1] interface Serial2/1<br />
[RTA-Serial2/1] ppp mp mp-group 1</p>
<p>[RTB] interface mp-group 1<br />
[RTB-Mp-group1] ip address 1.1.1.2 24<br />
[RTB-Mp-group1] interface Serial2/0<br />
[RTB-Serial2/0] ppp mp mp-group 1<br />
[RTB-Mp-group1] interface Serial2/1<br />
[RTB-Serial2/1] ppp mp mp-group 1</p>
<p><strong>参考资料</strong>：H3CNE6.0 PPT  X00070003 第30章 配置PPP</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ipcpu.com/2010/05/h3c-mppp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco MP(multilink ppp)的配置</title>
		<link>http://www.ipcpu.com/2010/05/mppp-configure/</link>
		<comments>http://www.ipcpu.com/2010/05/mppp-configure/#comments</comments>
		<pubDate>Fri, 07 May 2010 12:52:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[网络技术]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[MP]]></category>
		<category><![CDATA[MPPP]]></category>
		<category><![CDATA[multilink ppp]]></category>
		<category><![CDATA[PPP]]></category>
		<category><![CDATA[配置]]></category>

		<guid isPermaLink="false">http://www.ipcpu.com/?p=505</guid>
		<description><![CDATA[两种配置方法。一种是通过配置虚拟模板接口（Virtual-Template，VT）来实现MP，另一种是利用MP-Group接口实现MP。 方法一mp group： interface Multilink1  ip address 192.168.0.1 255.255.255.0  ppp multilink  multilink-group 1 ! interface Serial0/0  no ip address  encapsulation ppp  serial restart-delay 0  ppp multilink  multilink-group 1 ! interface Serial0/1  no ip address  encapsulation ppp  serial restart-delay 0  ppp multilink  multilink-group 1 ! 注意事项： 1.输入ppp multilink group 1会自动转换为 ppp multilink multilink-group 1 2.保障接口 no [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ipcpu.com/wp-content/uploads/2010/05/mp_r1_c1.jpg"><img class="alignnone size-full wp-image-506" title="mp_r1_c1" src="http://www.ipcpu.com/wp-content/uploads/2010/05/mp_r1_c1.jpg" alt="" width="480" height="203" /></a></p>
<p>两种配置方法。一种是通过配置虚拟模板接口（Virtual-Template，VT）来实现MP，另一种是利用MP-Group接口实现MP。</p>
<p><strong>方法一mp group：</strong></p>
<p>interface Multilink1<br />
 ip address 192.168.0.1 255.255.255.0<br />
 ppp multilink<br />
 multilink-group 1<br />
!<br />
interface Serial0/0<br />
 no ip address<br />
 encapsulation ppp<br />
 serial restart-delay 0<br />
 ppp multilink<br />
 multilink-group 1<br />
!<br />
interface Serial0/1<br />
 no ip address<br />
 encapsulation ppp<br />
 serial restart-delay 0<br />
 ppp multilink<br />
 multilink-group 1<br />
!</p>
<p>注意事项：<span id="more-505"></span></p>
<p>1.输入ppp multilink group 1会自动转换为<br />
ppp multilink<br />
multilink-group 1</p>
<p>2.保障接口 no shutdown</p>
<p>参考资料：</p>
<p><a href="http://dreamearth.blog.51cto.com/616542/149360">http://dreamearth.blog.51cto.com/616542/149360</a></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p><strong>方法二：使用virtual-template</strong>：</p>
<p>multilink virtual-template 1<br />
!<br />
interface Virtual-Template1<br />
 ip address 192.168.0.1 255.255.255.0<br />
 ppp multilink<br />
!<br />
interface Serial0/0<br />
 encapsulation ppp<br />
 ppp multilink<br />
!<br />
interface Serial0/1<br />
 encapsulation ppp<br />
 ppp multilink</p>
<p>实验验证：</p>
<p>Router#sh ip int bri<br />
Interface                  IP-Address      OK? Method Status                Protocol<br />
Serial0/0                  unassigned      YES unset  up                    up     <br />
Serial0/1                  unassigned      YES unset  up                    up       <br />
Virtual-Access1            192.168.0.1     YES TFTP   up                    up     <br />
Virtual-Template1          192.168.0.1     YES manual down                  down   <br />
Router#sh int virtual-access 1<br />
Virtual-Access1 is up, line protocol is up<br />
  Hardware is Virtual Access interface<br />
  Internet address is 192.168.0.1/24<br />
  MTU 1500 bytes, <strong><span style="color: #ff0000;">BW 3088 Kbit,</span></strong> DLY 100000 usec,<br />
     reliability 255/255, txload 1/255, rxload 1/255<br />
  Encapsulation PPP, loopback not set</p>
<p>切断一条链路后</p>
<p>Router#sh ip int bri  <br />
Interface                  IP-Address      OK? Method Status                Protocol<br />
Serial0/0                  unassigned      YES unset  up                    down   <br />
Serial0/1                  unassigned      YES unset  up                    up      <br />
Virtual-Access1            192.168.0.1     YES TFTP   up                    up     <br />
Virtual-Template1          192.168.0.1     YES manual down                  down   </p>
<p>参考资料：</p>
<p><a href="http://ltyluck.blog.51cto.com/170459/214877">http://ltyluck.blog.51cto.com/170459/214877</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ipcpu.com/2010/05/mppp-configure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>企业网常用NAT配置</title>
		<link>http://www.ipcpu.com/2010/05/smb-nat-configure/</link>
		<comments>http://www.ipcpu.com/2010/05/smb-nat-configure/#comments</comments>
		<pubDate>Tue, 04 May 2010 10:58:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[网络技术]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[NAT]]></category>
		<category><![CDATA[企业]]></category>
		<category><![CDATA[网络]]></category>
		<category><![CDATA[网络设计]]></category>
		<category><![CDATA[配置]]></category>

		<guid isPermaLink="false">http://www.ipcpu.com/?p=492</guid>
		<description><![CDATA[1.动态NAT（PAT）和静态NAT 企业边缘路由器配置： interface FastEthernet0/0 ip address 1.1.1.1 255.255.255.0 ip nat inside duplex auto speed auto ! interface FastEthernet0/1 ip address 2.2.2.1 255.255.255.0 ip nat outside duplex auto speed auto !配置入口和出口 ip nat inside source static 1.1.1.2 2.2.2.11 !静态NAT ip nat pool xixi 2.2.2.101 2.2.2.110 netmask 255.255.255.0 ip nat inside source list 1 pool xixi overload [...]]]></description>
			<content:encoded><![CDATA[<p><strong>1.动态NAT（PAT）和静态NAT</strong></p>
<p><a href="http://www.ipcpu.com/wp-content/uploads/2010/05/NAT_r1_c1.jpg"><img class="alignnone size-full wp-image-493" title="NAT_r1_c1" src="http://www.ipcpu.com/wp-content/uploads/2010/05/NAT_r1_c1.jpg" alt="" width="480" height="371" /></a></p>
<p>企业边缘路由器配置：<br />
<span style="color: #99cc00;"><span style="color: #0000ff;">interface FastEthernet0/0</span><br />
<span style="color: #0000ff;"> ip address 1.1.1.1 255.255.255.0</span><br />
<span style="color: #0000ff;"> ip nat inside</span><br />
<span style="color: #0000ff;"> duplex auto</span><br />
<span style="color: #0000ff;"> speed auto</span><br />
<span id="more-492"></span><span style="color: #0000ff;">!</span><br />
<span style="color: #0000ff;"> interface FastEthernet0/1</span><br />
<span style="color: #0000ff;"> ip address 2.2.2.1 255.255.255.0</span><br />
<span style="color: #0000ff;"> ip nat outside</span><br />
<span style="color: #0000ff;"> duplex auto</span><br />
<span style="color: #0000ff;"> speed auto</span><br />
<span style="color: #0000ff;"> !配置入口和出口</span><br />
<span style="color: #0000ff;"> ip nat inside source static 1.1.1.2 2.2.2.11</span><br />
<span style="color: #0000ff;"> !静态NAT</span><br />
<span style="color: #0000ff;"> ip nat pool xixi 2.2.2.101 2.2.2.110 netmask 255.255.255.0</span><br />
<span style="color: #0000ff;"> ip nat inside source list 1 pool xixi overload</span><br />
<span style="color: #0000ff;"> !动态NAT（PAT）先定义ACL和NAT pool 做映射即可</span><br />
<span style="color: #0000ff;"> access-list 1 permit 1.1.1.0 0.0.0.255</span><br />
<span style="color: #0000ff;"> !ACL，实际根据需要可以只放行HTTP</span><br />
<span style="color: #0000ff;"> ip route 0.0.0.0 0.0.0.0 2.2.2.2</span><br />
<span style="color: #0000ff;"> !默认路由不做不行啊</span></span></p>
<p><strong>2.外网口使用连接地址（一般为私有地址）</strong><br />
出口和NAT的地址不在同一网段，一般这种情况发生在光纤入户企业，拥有一段公网IP地址<br />
假设为202.102.134.0/29,ISP将此段地址静态路由指过来了<br />
<span style="color: #0000ff;"><a href="http://www.ipcpu.com/wp-content/uploads/2010/05/NAT_r1_c2.jpg"><img class="alignnone size-full wp-image-494" title="NAT_r1_c2" src="http://www.ipcpu.com/wp-content/uploads/2010/05/NAT_r1_c2.jpg" alt="" width="480" height="230" /></a></span></p>
<p><span style="color: #0000ff;">ISP配置：<br />
ip route 202.102.134.0 255.255.255.248 10.1.10.2<br />
企业边缘路由器配置：</span></p>
<p><span style="color: #0000ff;">interface FastEthernet0/0<br />
ip address 192.168.0.1 255.255.255.0<br />
ip nat inside<br />
duplex auto<br />
speed auto<br />
!入口<br />
interface FastEthernet0/1<br />
ip address 10.1.10.2 255.255.255.0<br />
ip nat outside<br />
duplex auto<br />
speed auto<br />
!出口</span></p>
<p><span style="color: #0000ff;">ip route 0.0.0.0 0.0.0.0 10.1.10.1<br />
!这个不做不行呀！<br />
ip nat pool haha 202.102.134.3 202.102.134.6 netmask 255.255.255.248<br />
ip nat inside source list 1 pool haha overload<br />
ip nat inside source static 192.168.0.2 202.102.134.1<br />
!<br />
access-list 1 permit 192.168.0.0 0.0.0.255<br />
!ACL</span></p>
<p>上述情况中如果发布一台web服务器，192.168.0.2（202.102.134.1），很显然DNS解析到202.102.134.1（有钱的可以弄个智能DNS解析，根据源地址不同做不同解析），我们看一下这个过程。</p>
<p>内网192.168.0.3 访问202.102.134.1  数据包到达路由器查看路由表：<br />
Gateway of last resort is 10.1.10.1 to network 0.0.0.0</p>
<p>10.0.0.0/24 is subnetted, 1 subnets<br />
C       10.1.10.0 is directly connected, FastEthernet0/1<br />
C    192.168.0.0/24 is directly connected, FastEthernet0/0<br />
S*   0.0.0.0/0 [1/0] via 10.1.10.1<br />
Router#<br />
很显然数据包发往ISP路由器，ISP有去往202.102.134.0/29的路由，又指了回来。正常访问，而本文刚开始的第一种情况就不行。</p>
<p><a href="http://www.ipcpu.com/wp-content/uploads/2010/05/NAT_r1_c3.jpg"><img class="alignnone size-full wp-image-495" title="NAT_r1_c3" src="http://www.ipcpu.com/wp-content/uploads/2010/05/NAT_r1_c3.jpg" alt="" width="307" height="170" /></a></p>
<p>实际工程中，很多企业会在内网口f0/0绑一个公网地址做网关，然后内网的电脑就可以配公网IP了。<br />
这只是其中一种方式，有些网吧，内网用公网地址，都不用做NAT的。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ipcpu.com/2010/05/smb-nat-configure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

