[Juniper] common configuration methods for daily maintenance of switches and routine maintenance of juniper
The juniper device is different from other vendors, and adopts the configuration concept of submitting for effectiveness. This greatly reduces misoperations. Note: All configurations do not take effect immediately after they are configured. You need to submit a commit statement to take effect.
Note that when you log on with the root user, after entering the account/password, the shell mode is enabled by default (only the root user account has this phenomenon). Enter the cli command to enter the user mode:
In user mode, enter the configure command to enter the configuration mode. In configuration mode, you can configure various parameters for the device.
There is no password for initializing the root user. During the first configuration, you must configure the root password to make the commit successful. The password is a combination of letters and numbers.
Set system login user juniper authenticationplain-text-password <-set the password of the juniper user
Note: The telnet function is disabled by default. you can log on to the network device only after the telnet service is enabled.
Note: The ftp function is disabled by default. Only after the ftp service is enabled can ftp be transferred from the network to the network device.
# Setting SNMP stringsSet snmp trap-options source-address192.168.1.1 # set the original address of snmp trap to 192.168.1.1
Set snmp contact
# Set snmp contact information
Set snmp engine-id local
# Set the snmp v3 engine ID
Set snmp description
# Set snmp System Description
2.7 configure the physical port parameter 2.7.1 configure the port descriptionUser @ host # set interface ge-slot/pic/port description
2.7.2 configure the port MTUUser @ host # set interface ge-slot/pic/port mtu-number
2.7.3 configure the port speedUser @ host # set interface ge-slot/pic/port ether-options speed (10 m | 100 m | 1g)
2.7.4 Configure port duplexUser @ host # set interface ge-0/0/0 ether-options link-mode (automatic | full-duplex |
Half-duplex)
2.7.5 Configure Automatic port negotiationUser @ host # set interface ge-0/0/0 ether-options (auto-negotiation |
No-auto-negotiation)
Note: user @ host # set interface ge-0/0/0ether-options no-auto-negotiation needs to be configured to force duplex or force rate
Root @ host # set interfaces Co., ge-3/0/0 ether-optionsauto-negotiation
2.7.6 close the portRoot @ host # set interfaces ge-0/0/0 disable
2.7.7 configure the physical port L2 InterfaceRoot @ host # set interfaces ge-0/0/16 unit 0 familyethernet-switching port-mode access
2.7.8 configure Layer-3 interfaces for physical portsThe physical interface of the EX switch supports the layer-3 routing interface function, and you can directly configure the layer-3 address on the interface.
Root @ host # set interfaces ge-0/0/17 unit 0 family inet address 192.168.20.1/24
2.8 configure VLANDuring configuration initialization, all ports belong to the default VLAN, and the default ID of the defavlan VLAN is 0.
2.8.1 create a L2 VLANSet vlans vlan100 vlan-id 100
2.8.2 create a layer-3 vlanSet vlans vlan2061 descriptionGUANLI
Set vlans vlan2061 vlan-id 2061
Set vlans vlan2061 l3-interfacevlan.2061
Set interfaces vlan unit 2061 familyinet address 172.16.61.52/24
2.8.3 interface VLANConfigure VLAN 100 ACCESSS for the port
Root @ host # set interfaces ge-0/0/1 unit 0 family ethernet-switchingvlan members 100
2.8.4 configure Vlan trunkConfigure the port as the trunk port and support standard encapsulation of 802.1Q.
User @ host # set interfaces name unit 0 family ethernet-switchingport-mode trunk
# Set the VLAN mode of the port to trunk.
User @ host # set interfaces name unit 0 family ethernet-switchingvlan members (all | number)
2.8.5 configure native-vlan-idEX supports native-vlan (VLAN for tag splitting) configuration under the trunk Port:
Root @ host # set interface ge-0/0/8 unit 0 family Ethernet-switchnative-vlan-id purple
2.14 Static Routing ProtocolSet routing-options static route 0.0.0.0/0 next-hop172.16.61.1
3DHCP settingsSet system services dhcp name-server 202.118.176.2
Primary DNS Configuration
Set system services dhcp name-server 114.114.114.114
Backup DNS Configuration
Set system services dhcp pool 10.30.0.0/24 address-range low10.30.0.10
Set system services dhcp pool 10.30.0.0/24 address-range high10.30.0.254
Address pool range
Set system services dhcp pool 10.30.0.0/24 router 10.30.0.1
The address pool gateway also represents the VLAN of the bound gateway.
Set interfaces vlan unit 201 familyinet address 10.30.0.1/24
Configure VLAN addresses
Set vlans vlan201 vlan-id 201
Create VLAN
Set vlans vlan201 l3-interfacevlan.201
Add a VLAN layer-3 interface.
4 troubleshooting 4.1 view hardware operation informationWlzx @ 5_2 # run show chassis routing-engine
Routing Engine status:
Slot 0:
Current stateMaster
Temperature 33 degrees C/91 degrees F
CPUtemperature 33 degrees C/91 degrees F
DRAM 1024
Memory utilization 50 percent
CPUutilization:
User 0 percent
Background 0 percent
Kernel 0 percent
Interrupt 0 percent
Idle 100 percent
ModelEX4200-48T, 8 POE
Serial ID BP0214300255
Starttime 2013-09-1306: 55: 06 UTC
Uptime 29 days, 21 hours, 44 minutes, 30 seconds
Lastreboot reason 0x1: powercycle/failure
Loadaverages: 1 minute 5 minute15 minute
0.16 0.06 0.02
4.2 production view ARP tableWlzx @ 5_2 # run show arp
MAC Address Name Interface Flags
70: f9: 6d: 18: 2a: e5 172.16.61.1 172.16.61.1 vlan.2061 none
70: f9: 6d: a1: d6: 24 172.16.61.11 172.16.61.11 vlan.2061 none
70: f9: 6d: a1: d5: ea 172.16.61.12 172.16.61.12 vlan.2061 none
70: f9: 6d: a1: d1: 9c 172.16.61.13 172.16.61.13 vlan.2061 none
70: f9: 6d: a1: d5: 3c 172.16.61.21 172.16.61.21 vlan.2061 none
70: f9: 6d: a2: 14: 72 172.16.61.31 172.16.61.31 vlan.2061 none
70: f9: 6d: a1: cd: 4e 172.16.61.32 172.16.61.32 vlan.2061 none
70: f9: 6d: a1: cf: 92 172.16.61.33 172.16.61.33 vlan.2061 none
70: f9: 6d: a1: d0: 40 172.16.61.34 172.16.61.34 vlan.2061 none
64: 64: 9b: f0: c6: 01 172.16.61.35 172.16.61.35 vlan.2061 none
64: 64: 9b: f0: c1: 01 172.16.61.36 172.16.61.36 vlan.2061 none
64: 64: 9b: f0: 76: 81 172.16.61.37 172.16.61.37 vlan.2061 none
70: f9: 6d: a1: cf: 1e 172.16.61.61 172.16.61.61 vlan.2061 none
70: f9: 6d: a1: cd: c2 172.16.61.62 172.16.61.62 vlan.2061 none
70: f9: 6d: a1: d3: e0 172.16.61.81 172.16.61.81 vlan.2061 none
70: f9: 6d: a1: d0: 7a 172.16.61.91 172.16.61.91 vlan.2061 none
70: f9: 6d: a1: cc: da 172.16.61.92 172.16.61.92 vlan.2061 none
70: f9: 6d: a1: cc: 2c 172.16.61.93 172.16.61.93 vlan.2061 none
70: f9: 6d: a1: d6: d2 172.16.61.101 172.16.61.101 vlan.2061 none
64: 64: 9b: 14: ba: 81 172.16.61.103 172.16.61.103 vlan.2061 none
70: f9: 6d: 83: c4: 2e 172.16.61.121 172.16.61.121 vlan.2061 none
70: f9: 6d: a1: d2: 10 172.16.61.122 172.16.61.122 vlan.2061 none
5c: dd: 70: 04: 21: 52 172.16.61.123 172.16.61.123 vlan.2061 none
70: f9: 6d: a1: d4: 1a 172.16.61.124 172.16.61.124 vlan.2061 none
70: f9: 6d: a1: d5: 02 172.16.61.125 172.16.61.125 vlan.2061 none
70: f9: 6d: a1: d5: b0 172.16.61.126 172.16.61.126 vlan.2061 none
70: f9: 6d: a2: 11: 46 172.16.61.131 172.16.61.131 vlan.2061 none
70: f9: 6d: a1: cf: cc 172.16.61.132 172.16.61.132 vlan.2061 none
70: f9: 6d: a1: d0: ee 172.16.61.141 172.16.61.141 vlan.2061 none
70: f9: 6d: a2: 0b: 28 172.16.61.142172.16.61.142vlan.2061 none
4.3 view VLAN InformationWlzx @ 5_2 # run showvlans
Name Tag Interfaces
_ Pvlan_vlan502_ge-0/0/0.0 __
Ge-0/0/0.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/1.0 __
Ge-0/0/1.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/10.0 __
Ge-0/0/10.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/11.0 __
Ge-0/0/11.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/12.0 __
Ge-0/0/12.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/13.0 __
Ge-0/0/13.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/14.0 __
Ge-0/0/14.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/15.0 __
Ge-0/0/15.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/16.0 __
Ge-0/0/16.0 *, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/17.0 __
Ge-0/0/17.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/18.0 __
Ge-0/0/18.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/19.0 __
Ge-0/0/19.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/2.0 __
Ge-0/0/2.0 *, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/20.0 __
Ge-0/0/20.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/21.0 __
Ge-0/0/21.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/22.0 __
Ge-0/0/22.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/23.0 __
Ge-0/0/23.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/24.0 __
Ge-0/0/24.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/25.0 __
Ge-0/0/25.0 *, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/26.0 __
Ge-0/0/26.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/27.0 __
Ge-0/0/27.0 *, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/28.0 __
Ge-0/0/28.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/29.0 __
Ge-0/0/29.0 *, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/3.0 __
Ge-0/0/3.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/30.0 __
Ge-0/0/30.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/31.0 __
Ge-0/0/31.0 *, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/32.0 __
Ge-0/0/32.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/33.0 __
Ge-0/0/33.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/34.0 __
Ge-0/0/34.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/35.0 __
Ge-0/0/35.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/36.0 __
Ge-0/0/36.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/37.0 __
Ge-0/0/37.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/38.0 __
Ge-0/0/38.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/39.0 __
Ge-0/0/39.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/4.0 __
Ge-0/0/4.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/40.0 __
Ge-0/0/40.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/41.0 __
Ge-0/0/41.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/42.0 __
Ge-0/0/42.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/43.0 __
Ge-0/0/43.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/44.0 __
Ge-0/0/44.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/45.0 __
Ge-0/0/45.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/46.0 __
Ge-0/0/46.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/47.0 __
Ge-0/0/47.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/5.0 __
Ge-0/0/5.0 *, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/6.0 __
Ge-0/0/6.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/7.0 __
Ge-0/0/7.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/8.0 __
Ge-0/0/8.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/0/9.0 __
Ge-0/0/9.0, ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/1/0.0 __
Ge-0/1/3.0 *
_ Pvlan_vlan502_ge-0/1/1.0 __
Ge-0/1/3.0 *
Default
None
Vlan2061 2061
Ge-0/1/3.0 *
Vlan502502
Ge-0/0/0.0, ge-0/0/1.0, ge-0/0/2.0 *, ge-0/0/3.0, ge-0/0/4.0, ge-0/0/5.0 *, ge-0/0/6.0, ge-0/0/7.0, ge-0/0/8.0, ge-0/0/9.0, ge-0/0/10.0,
Ge-0/0/11.0, ge-0/0/12.0, ge-0/0/13.0, ge-0/0/14.0, ge-0/0/15.0, ge-0/0/16.0 *, ge-0/0/17.0, ge-0/0/18.0, ge-0/0/19.0, ge-0/0/20.0,
Ge-0/0/21.0, ge-0/0/22.0, ge-0/0/23.0, ge-0/0/24.0, ge-0/0/25.0 *, ge-0/0/26.0, ge-0/0/27.0 *, ge-0/0/28.0, ge-0/0/29.0 *, ge-0/0/30.0,
Ge-0/0/31.0 *, ge-0/0/32.0, ge-0/0/33.0, ge-0/0/34.0, ge-0/0/35.0, ge-0/0/36.0, ge-0/0/37.0, ge-0/0/38.0, ge-0/0/39.0, ge-0/0/40.0,
Ge-0/0/41.0, ge-0/0/42.0, ge-0/0/43.0, ge-0/0/44.0, ge-0/0/45.0, ge-0/0/46.0, ge-0/0/47.0, ge-0/1/3.0 *
Note:PVLANIsVlanIsolation, followed by port"*"Indicates the port.UpStatus.
4.4 view a VLAN separatelyWlzx @ 5_2 # run showvlans 2061
Name Tag Interfaces
Vlan2061 2061
Ge-0/1/3.0 *
{Master: 0} [edit]
4.5 View InterfaceWlzx @ 5_2 # run showinterfaces terse
Interface Admin Link Proto Local Remote
Ge-0/0/0 up down
Ge-0/0/0.0 up down eth-switch
Ge-0/0/1 up down
Ge-0/0/1.0 up down eth-switch
Up ge-0/0/2
Ge-0/0/2.0 up upeth-switch
Ge-0/0/3 up down
Ge-0/0/3.0 up down eth-switch
Ge-0/0/4 up down
Ge-0/0/4.0 up down eth-switch
Up ge-0/0/5
Ge-0/0/5.0 up upeth-switch
Ge-0/0/6 up down
Ge-0/0/6.0 up down eth-switch
Ge-0/0/7 up down
Ge-0/0/7.0 up down eth-switch
Ge-0/0/8 up down
Ge-0/0/8.0 up down eth-switch
Ge-0/0/9 up down
Ge-0/0/9.0 up down eth-switch
Ge-0/0/10 up down
Ge-0/0/10.0 up down eth-switch
Ge-0/0/11 up down
Ge-0/0/11.0 up down eth-switch
Ge-0/0/12 up down
Ge-0/0/12.0 up down eth-switch
Ge-0/0/13 up down
Ge-0/0/13.0 up down eth-switch
Ge-0/0/14 up down
Ge-0/0/14.0 up down eth-switch
Ge-0/0/15 updown
Ge-0/0/15.0 up down eth-switch
Up ge-0/0/16
Ge-0/0/16.0 up upeth-switch
Ge-0/0/17 up down
Ge-0/0/17.0 up down eth-switch
Ge-0/0/18 up down
Ge-0/0/18.0 up down eth-switch
Ge-0/0/19 up down
Ge-0/0/19.0 up down eth-switch
Ge-0/0/20 up down
Ge-0/0/20.0 up down eth-switch
Ge-0/0/21 up down
Ge-0/0/21.0 updown eth-switch
Ge-0/0/22 up down
Ge-0/0/22.0 up down eth-switch
Ge-0/0/23 up down
Ge-0/0/23.0 up down eth-switch
Ge-0/0/24 up down
Ge-0/0/24.0 up down eth-switch
Up ge-0/0/25
Ge-0/0/25.0 up upeth-switch
Ge-0/0/26 up down
Ge-0/0/26.0 up down eth-switch
Up ge-0/0/27
Ge-0/0/27.0 up upeth-switch
Ge-0/0/28 up down
Ge-0/0/28.0 up down eth-switch
Up ge-0/0/29
Ge-0/0/29.0 up upeth-switch
Ge-0/0/30 up down
Ge-0/0/30.0 up down eth-switch
Up ge-0/0/31
Ge-0/0/31.0 up upeth-switch
Ge-0/0/32 up down
Ge-0/0/32.0 up down eth-switch
Ge-0/0/33 up down
Ge-0/0/33.0 up down eth-switch
Ge-0/0/34 up down
Ge-0/0/34.0 up down eth-switch
Ge-0/0/35 up down
Ge-0/0/35.0 up down eth-switch
Ge-0/0/36 up down
Ge-0/0/36.0 up down eth-switch
Ge-0/0/37 up down
Ge-0/0/37.0 up down eth-switch
Ge-0/0/38 up down
Ge-0/0/38.0 up down eth-switch
Ge-0/0/39 up down
Ge-0/0/39.0 up down eth-switch
Ge-0/0/40 up down
Ge-0/0/40.0 updown eth-switch
Ge-0/0/41 up down
Ge-0/0/41.0 up down eth-switch
Ge-0/0/42 up down
Ge-0/0/42.0 up down eth-switch
Ge-0/0/43 up down
Ge-0/0/43.0 up down eth-switch
Ge-0/0/44 up down
Ge-0/0/44.0 up down eth-switch
Ge-0/0/45 up down
Ge-0/0/45.0 up down eth-switch
Ge-0/0/46 up down
Ge-0/0/46.0 up down eth-switch
Ge-0/0/47 up down
Ge-0/0/47.0 up down eth-switch
Up ge-0/1/3
Ge-0/1/3.0 up upeth-switch
Vcp-0 up down
Vcp-0.32768 up down
Vcp-1 updown
Vcp-1.32768 up down
Bme0 up
Bme0.32768 up upinet 128.0.0.1/2
128.0.0.16/2
128.0.0.32/2
Tnp 0x10
Dsc up
Gre up
Ipip up
Lo0 up
Lo0.16384 up upinet 127.0.0.1 -- & gt; 0/0
Lsi up
Me0 up down
Me0.0 up down eth-switch
Mtun up
Pimd up
Pime up
Tap upup
Vlan up
Vlan.0 up down inet
Vlan.2061 up upinet 172.16.61.52/24
Vme up down
Vme.0 up down inet
{Master: 0} [edit]
4.6 view VLAN trafficWlzx @ 5_2 # run showinterfaces vlan.2061
Logical interface vlan.2061 (Index 117) (SNMPifIndex 601)
Flags: SNMP-Traps 0x0 Encapsulation: ENET2
Input packets: 935958
Output packets: 20227
Protocol inet, MTU: 1500
Flags: None
Addresses, Flags: Is-Preferred Is-Primary
Destination: 172.16.61/24, Local: 172.16.61.52, Broadcast: 172.16.61.255
{Master: 0} [edit]
4.7 view interface trafficWlzx @ 5_2 # run showinterfaces ge-0/0/3
Physicalinterface: ge-0/0/3, Enabled, Physical link is Down
Interface index: 132, SNMP ifIndex: 508
Link-level type: Ethernet, MTU: 1514, Speed: Auto, Duplex: Auto, BPDU Error: None, MAC-REWRITE Error: None, Loopback: Disabled, Source filtering: Disabled,
Flow control: Enabled, Auto-negotiation: Enabled, Remote fault: Online, Media type: Copper
Device flags: Present Running
Interface flags: Hardware-Down SNMP-TrapsInternal: 0x0
Link flags: None
CoS queues: 8 supported, 8 maximum usable queues
Current address: 64: 64: 9b: f0: 58: 06, Hardwareaddress: 64: 64: 9b: f0: 58: 06
Last flapped: Never
Input rate: 0 bps (0 pps)
Output rate: 0 bps (0 pps)
Active alarms: LINK
Active defects: LINK
Interface transmit statistics: Disabled
Logical interface ge-0/0/3.0 (Index 70) (SNMPifIndex 509)
Flags: Device-Down SNMP-Traps 0x0Encapsulation: ENET2
Input packets: 0
Output packets: 0
Protocol eth-switch
Flags: None