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

获取配置

  • 在>模式下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            

    
            18.2R2.6
            
                
                    
                        netops
                        203
                        super-user
                        
                            $6$mwui2YJC$hwpYnF/ljvl7TweOScRc01quhxDDb9voP4mwtMyo0NqSXGDWEuoiRsGQ4mYWcK2Tv0OBEogBkBjZViQH6iMqn0
                        
                    
                

粘贴配置

  • 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交换机配置的一些小技巧)