Switching

last person joined: 13 hours ago 

Ask questions and share experiences about EX and QFX portfolios and all switching solutions across your data center, campus, and branch locations.
  • 1.  command to get IPv4 addresses configured on all interface.

    Posted 07-05-2013 13:14

    what command can I use to find out IPv4 addresses configured on all interface.

    One of the commands I found is show interfaces terse but it has IPv6 addresses as well.

     

     



  • 2.  RE: command to get IPv4 addresses configured on all interface.

     
    Posted 07-05-2013 14:05

    show configuration interfaces | display set | match "inet address" | except vrrp-group | no-more

     



  • 3.  RE: command to get IPv4 addresses configured on all interface.

    Posted 07-05-2013 14:08

    you can try the following :

     

    SW > conf

    SW # show interfaces | match inet

    SW # show | display set | match inet 

     

    **************  Click on the button saying " Accept  as Solution"  if  My Post solved your problem  **************

     



  • 4.  RE: command to get IPv4 addresses configured on all interface.
    Best Answer

    Posted 07-05-2013 14:11

    Hello,

    You can add modifiers (UNIX regexp-based) to "show interfaces terse" to display only those interfaces with IPv4 addresses:

     

    root@mx80> show interfaces terse | grep "[0-9]{1,3}\.[0-9]{1,3}\."   
    ge-1/1/1.10             up    up   inet     198.18.10.1/30  
                                                198.18.10.5/30  
    ge-1/1/1.30             up    up   inet     198.18.30.1/30  
    ge-1/1/1.31             up    up   inet     198.18.180.30/31
    ge-1/1/1.32             up    up   inet     198.18.132.0/31 
    ge-1/1/6.2              up    up   inet     198.18.2.1/30   
    ge-1/1/6.3              up    up   inet     198.18.3.1/30   
    ge-1/1/6.10             up    up   inet     198.18.10.10/24 
    ge-1/1/6.12             up    up   inet     198.18.12.10/24 
    ge-1/1/6.21             up    up   inet     198.18.21.0/31  
    ge-1/1/6.22             up    up   inet     198.18.22.0/31  
    ge-1/1/6.100            up    up   inet     169.254.1.1/30  
    ge-1/1/6.2122           up    up   inet     198.18.22.3/31  
    ge-1/1/7.2              up    up   inet     198.18.2.2/30   
    ge-1/1/7.3              up    up   inet     198.18.3.2/30   
    ge-1/1/7.11             up    up   inet     198.18.10.11/24 
    ge-1/1/7.12             up    up   inet     198.18.12.11/24 
    ge-1/1/7.21             up    up   inet     198.18.21.1/31  
    ge-1/1/7.22             up    up   inet     198.18.22.1/31  
    ge-1/1/7.100            up    up   inet     169.254.1.2/30  
    ge-1/1/7.105            up    up   inet     198.18.105.1/31 
    ge-1/1/7.300            up    up   inet     169.254.1.2/24  
    ge-1/1/7.2022           up    up   inet     169.254.202.7/24
    ge-1/1/7.2122           up    up   inet     198.18.22.2/31  
    ge-1/1/7.4094           up    up   inet     169.254.40.194/24
    ge-1/1/8.1              down  up   inet     198.18.1.1/30   
    ge-1/1/8.22             up    up   inet     198.18.22.1/30  
    ge-1/1/8.100            up    up   inet     169.254.8.1/30  
    ge-1/1/8.1012           up    up   inet     198.18.12.1/30  
    ge-1/1/8.2011           up    up   inet     198.18.11.0/31  
    ge-1/1/8.2211           down  up   inet     198.18.221.1/30 
    ge-1/1/8.2511           up    up   inet     198.18.251.1/30 
    ge-1/1/9.1              down  up   inet     198.18.1.2/30   
    ge-1/1/9.22             up    up   inet     198.18.22.2/30  
    ge-1/1/9.100            up    up   inet     169.254.8.2/30  
    ge-1/1/9.300            up    up   inet     169.254.1.2/24  
    ge-1/1/9.1012           up    up   inet     198.18.12.2/30  
    ge-1/1/9.2011           up    up   inet     198.18.11.1/31  
    ge-1/1/9.2211           down  up   inet     198.18.221.2/30 
    ge-1/1/9.2511           up    up   inet     198.18.251.2/30 
    ge-1/1/10.1             up    up   inet     198.18.100.1/24 
    ge-1/1/10.1011          up    up   inet     198.18.199.0/31 
    ge-1/1/10.1012          up    up   inet     198.18.199.2/31 
    ge-1/1/10.2011          up    up   inet     198.18.199.22/31
    ge-1/1/11.1             up    up   inet     198.18.100.2/24 
    ge-1/1/11.1011          up    up   inet     198.18.199.1/31 
    ge-1/1/11.1012          up    up   inet     198.18.199.3/31 
    ge-1/1/11.2011          up    up   inet     198.18.199.23/31
    ge-1/1/11.2022          up    up   inet     169.254.202.11/24
    ge-1/1/11.4094          up    up   inet     169.254.40.94/24
    ae0.0                   up    up   inet     198.18.15.1/30  
    em0.0                   up    up   inet     10.0.0.4/8      
                                                128.0.0.1/2     
                                                128.0.0.4/2     
    fxp0.0                  up    up   inet     172.30.77.181/24
    irb.105                 up    down inet     198.18.105.0/31 
    irb.4094                up    up   inet     169.254.40.95/24
    lo0.0                   up    up   inet     198.18.0.3          --> 0/0
    lo0.1                   up    up   inet     203.0.113.1         --> 0/0
    lo0.2                   up    up   inet     203.0.113.2         --> 0/0
    lo0.3                   up    up   inet     203.0.113.3         --> 0/0
    lo0.11                  up    up   inet     198.18.0.11         --> 0/0
    lo0.12                  up    up   inet     198.18.0.6          --> 0/0
    lo0.33                  up    up   inet     198.51.100.33       --> 0/0
    lo0.34                  up    up   inet     198.51.100.34       --> 0/0
    lo0.41                  up    up   inet     198.51.100.41       --> 0/0
    lo0.43                  up    up   inet     198.51.100.43       --> 0/0
    lo0.44                  up    up   inet     198.51.100.44       --> 0/0
    lo0.111                 up    up   inet     198.51.111.111      --> 0/0
    lo0.202                 up    up   inet     198.51.100.202      --> 0/0
    lo0.222                 up    up   inet     198.51.100.222      --> 0/0
    lo0.1011                up    up   inet     198.18.254.1        --> 0/0
    lo0.2011                up    up   inet     198.18.0.32         --> 0/0
    lo0.2122                up    up   inet     198.18.0.22         --> 0/0
    lo0.16384               up    up   inet     127.0.0.1           --> 0/0
    

     If You want to display only those interfaces which have IPv4 address EXPLICITLY configured, You have to follow other poster' advice http://forums.juniper.net/t5/Ethernet-Switching/command-to-get-IPv4-addresses-configured-on-all-interface/m-p/198325#M8439 

    HTH

    Thanks

    Alex



  • 5.  RE: command to get IPv4 addresses configured on all interface.

    Posted 07-08-2013 15:10

    Because of this, I actually set up a pattern inside the interface description that includes the ip address.  The physical interface gets one description, typically a circuit ID or some other information regarding the physical link.  The logical unit gets a different description that starts with "ip/mask; ".

     

    One side benefit is that "show interface descriptions" only displays interfaces that have descriptions.  If you leave unused interfaces without a description, they are automatically filtered out without any additional work on your part.

     

    Here's an example of what I do:

    {master}
    cmyers@lab-ex8208-1.re0> show interfaces descriptions 
    Interface       Admin Link Description
    ge-0/0/0        up    up   v2148 access ports
    ge-0/0/3        up    up   v2150 access ports
    ge-1/0/1        up    up   ESX server   
    ge-2/0/0        up    up   lab-mgmt-sw port ge-0/0/8
    xe-3/0/0        up    up   LAG ae0:  To lab-ex8208-2 xe-3/0/0
    xe-3/0/1        up    up   LAG ae1:  To lab-mx960-1 xe-1/2/0
    xe-3/0/2        up    up   Ixia 5:13
    ae0             up    up   XLINK: 2x10G link to lab-ex8208-2
    ae1             up    up   UPLINK: 2x10G link to lab-mx960-1
    ae1.0           up    up   172.17.254.6/30; Routing link to lab-mx960-1
    me0             up    up   192.168.255.12/24; initial address for config
    vlan.2148       up    up   172.17.148.252/24; FX segment
    vlan.2150       up    up   172.17.150.252/24  
    vlan.2151       up    up   172.17.151.252/24; MM segment
    vlan.254        up    up   192.168.254.12/24; in-band management link
    

     The "v2148 access ports" and "v2150 acess ports" descriptions are just placeholders that I have set by default in the interface-range.  In production environments those are actually the server names.

     

    Cheers!

     

    -Chad