美文网首页
Juniper交换机配置的一些小技巧

Juniper交换机配置的一些小技巧

作者: ljyfree | 来源:发表于2020-04-08 09:11 被阅读0次

获取配置

  • 在>模式下show configuration

root@vMX-3> show configuration 
## Last commit: 2020-04-08 01:00:38 UTC by root
version 18.2R2.6;
system {
    login {
        user netops {
            uid 203;
            class super-user;
            authentication {
                encrypted-password "$6$NrImx9Ao$CT61gcQZ6X14xUiSo51Vddqqm9.CjS0SFdTlwYrq4yqKMDvQZZ8usmx8O6apuXOS5OdbSHyWDzZWT5UK2dan//"; ## SECRET-DATA
            }
        }
    }

  • 在#模式下show
root@vMX-3> configure 
Entering configuration mode

[edit]
root@vMX-3# show 
## Last changed: 2020-04-08 01:00:38 UTC
version 18.2R2.6;
system {
    login {
        user netops {
            uid 203;
            class super-user;
            authentication {
                encrypted-password "$6$NrImx9Ao$CT61gcQZ6X14xUiSo51Vddqqm9.CjS0SFdTlwYrq4yqKMDvQZZ8usmx8O6apuXOS5OdbSHyWDzZWT5UK2dan//"; ## SECRET-DATA
            }
        }
    }
  • 如果想获取set格式的配置,加"| display set"
root@vMX-3# show | display set 
set version 18.2R2.6
set system login user netops uid 203
set system login user netops class super-user
  • 如果想以NETCONF / XML格式显示,加"| display xml"
netops@vMX-1# show | display xml            
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/18.2R2/junos">
    <configuration junos:changed-seconds="1586308567" junos:changed-localtime="2020-04-08 01:16:07 UTC">
            <version>18.2R2.6</version>
            <system>
                <login>
                    <user>
                        <name>netops</name>
                        <uid>203</uid>
                        <class>super-user</class>
                        <authentication>
                            <encrypted-password>$6$mwui2YJC$hwpYnF/ljvl7TweOScRc01quhxDDb9voP4mwtMyo0NqSXGDWEuoiRsGQ4mYWcK2Tv0OBEogBkBjZViQH6iMqn0</encrypted-password>
                        </authentication>
                    </user>
                </login>

粘贴配置

  • set格式的配置,可以直接在#下粘贴
  • { }分层格式的配置,可以输入"load merge terminal relative ",然后直接粘贴,最后ctrl+c退出
netops@vMX-18# load merge terminal relative 
[Type ^D at a new line to end input]
protocols {
    bgp {                               
        group tf-peer {
            type internal;
            local-address 2.2.2.2;
            family inet-vpn {
                unicast;
            }
            family evpn {
                signaling;
            }
            family inet-mvpn {
                signaling;
            }
            family route-target;
            neighbor 192.168.122.177;
        }
    }
}

^C[abort]

[edit]
netops@vMX-18# 

相关文章

网友评论

      本文标题:Juniper交换机配置的一些小技巧

      本文链接:https://www.haomeiwen.com/subject/cylzphtx.html