EX交换机配置手册v1.2 - 图文

发布时间 : 星期六 文章EX交换机配置手册v1.2 - 图文更新完毕开始阅读

Possible completions:

Export policy ( Open an expression Test_Policy_1

[ Open a set of values [edit]

也可以直接输入T之后按TAB键来补全,而此时按空格键则无法补全:

lab@EX4200# set protocols ospf export T <-输入TAB键,则会补全Test_Policy_1 lab@EX4200# set protocols ospf export Test_Policy_1

1.2.4 用户模式和配置模式show的区别

在用户模式下,是无法进行配置操作的,而只能查看系统的一些参数。所以用户模式下的show命令是查看系统参数。要看系统配置则使用show configure命令。例如用户模式下show interface是查看端口信息:

lab@EX4200> show interfaces

Physical interface: ge-0/0/1, Enabled, Physical link is Up Interface index: 142, SNMP ifIndex: 31

Link-level type: Ethernet, MTU: 1518, Speed: 100mbps, Loopback: Disabled, Source filtering: Disabled, Flow control: Enabled

Device flags : Present Running

Interface flags: SNMP-Traps Internal: 0x4000

CoS queues : 4 supported, 4 maximum usable queues

Current address: 00:05:85:dc:cc:db, Hardware address: 00:05:85:dc:cc:db Last flapped : 2007-06-29 20:37:17 HKT (1w2d 00:31 ago) Input rate : 280 bps (0 pps) Output rate : 1280 bps (1 pps) Active alarms : None Active defects : None

Logical interface ge-0/0/1.0 (Index 83) (SNMP ifIndex 71)

Flags: SNMP-Traps 0x4000 VLAN-Tag [ 0x8100.33 ] Encapsulation: ENET2

第13页 共110页

Input packets : 0 Output packets: 0 Protocol inet, MTU: 1500 Flags: None lab@EX4200>

而在配置下show命令是显示相关的配置,比如show interface则是显示interface部分的配置:

lab@EX4200# show interfaces ge-0/0/1 { unit 0 {

family ethernet-switching vlan members 10 ; family inet; } }

[edit] lab@EX4200#

因此说用户模式和配置模式下的show命令是不同的,如果要在配置模式下运行用户模式命令,则需要在命令前面加一个run

lab@EX4200# run show interfaces

Physical interface: ge-0/0/1, Enabled, Physical link is Up Interface index: 142, SNMP ifIndex: 31

Link-level type: Ethernet, MTU: 1518, Speed: 100mbps, Loopback: Disabled, Source filtering: Disabled, Flow control: Enabled

Device flags : Present Running

Interface flags: SNMP-Traps Internal: 0x4000

CoS queues : 4 supported, 4 maximum usable queues

Current address: 00:05:85:dc:cc:db, Hardware address: 00:05:85:dc:cc:db

第14页 共110页

Last flapped : 2007-06-29 20:37:17 HKT (1w2d 00:36 ago) Input rate : 792 bps (0 pps) Output rate : 672 bps (0 pps) Active alarms : None Active defects : None

Logical interface ge-0/0/1.0 (Index 83) (SNMP ifIndex 71)

Flags: SNMP-Traps 0x4000 VLAN-Tag [ 0x8100.33 ] Encapsulation: ENET2 Input packets : 0 Output packets: 0 Protocol inet, MTU: 1500 Flags: None

[edit] lab@EX4200#

lab@EX4200# run ping 172.27.69.8

PING 172.27.69.8 (172.27.69.8): 56 data bytes

64 bytes from 172.27.69.8: icmp_seq=0 ttl=64 time=5.118 ms 64 bytes from 172.27.69.8: icmp_seq=1 ttl=64 time=7.949 ms 64 bytes from 172.27.69.8: icmp_seq=2 ttl=64 time=7.018 ms ^C

--- 172.27.69.8 ping statistics ---

3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max/stddev = 5.118/6.695/7.949/1.178 ms [edit] lab@EX4200#

lab@EX4200# run ping 172.27.69.8命令等同于lab@EX4200> ping 172.27.69.8

第15页 共110页

1.2.5 如何将配置转换成set命令

在配置模式下使用show或者在用户模式下使用show configure命令,输出结果是“程序化”的配置,这样的配置并不能直接粘贴到另外一台交换机上,不过可以在show后面使用管道符号加上display set将其转换成set格式命令,然后可以直接粘贴到其它交换机上:

lab@EX4200# show protocols ospf export Test_Policy_1; area 0.0.0.0 {

interface ge-0/0/1.0 { hello-interval 10; } } [edit]

lab@EX4200# show protocols ospf | display set set protocols ospf export Test_Policy_1

set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 hello-interval 10 [edit] lab@EX4200#

1.2.6 commit和rollback

在cisco中只要输入命令,回车之后命令马上生效,因为我们修改的就是系统正在使用的running-config配置文件。而在JUNOS中完全不同,我们操作(增加、删除、修改)的那份配置文件只是一个候选文件(candidate configure),并不是正在运行的配置文件,只有将候选文件通过commit提交之后,配置才会真正的应用到当前系统使用的active配置文件中,从而使得修改的配置生效。

第16页 共110页

联系合同范文客服:xxxxx#qq.com(#替换为@)