Ethernet Switching
Highlighted
Ethernet Switching

EX3300/3400 - Change Primary interface (instead of lo0)

‎06-26-2020 04:10 AM

Hello, 


As in description, how do i change the primary interface for default-adress-selection to be another interface then lo0?
I would prefer if it was the DG of irb.101

Adding Primary to any unit/irb interface configuration doesnt seem to wanna work.

The configuration below alows me to send UDP syslog traffic from system but i cant use services as FTP and such.
Is there anyway to configure a different default IP?

set interfaces lo0 unit 0 family inet address 10.99.99.40/32
set interfaces irb unit 101 family inet address 172.16.20.254/24
set interfaces irb unit 911 family inet address 10.99.92.46/29

 

set routing-instances 901 instance-type virtual-router
set routing-instances 901 interface irb.101
set routing-instances 901interface irb.901
set routing-instances 901 interface irb.911
set routing-instances 901 interface lo0.0
set routing-instances 901 routing-options interface-routes rib-group inet VRF->MASTER
set routing-instances 901 routing-options router-id 10.99.99.40
set routing-instances 901 forwarding-options dhcp-relay server-group dhcps-data 172.18.1.104
set routing-instances 901 forwarding-options dhcp-relay server-group dhcps-data 172.18.1.105
set routing-instances 901 forwarding-options dhcp-relay active-server-group dhcps-data
set routing-instances 901 forwarding-options dhcp-relay group dhcps-data interface irb.101
set routing-instances 901 protocols ospf traceoptions file trace-ospf
set routing-instances 901 protocols ospf traceoptions flag all
set routing-instances 901 protocols ospf area 0.0.0.0 interface irb.901
set routing-instances 901 protocols ospf area 0.0.0.0 interface lo0.0 passive
set routing-instances 901 protocols ospf area 0.0.0.0 interface irb.101 passive
set routing-instances 901 protocols ospf area 0.0.0.0 interface irb.911


set routing-options interface-routes rib-group inet MASTER->VRF
set routing-options static route 172.18.1.4/32 next-hop 10.99.92.41
set routing-options static route 172.16.8.11/32 next-hop 10.99.92.41
set routing-options static route 172.18.100.58/32 next-hop 10.99.92.41
set routing-options static route 172.16.1.250/32 next-hop 10.99.92.41
set routing-options rib-groups VRF->MASTER import-rib 901-Data.inet.0
set routing-options rib-groups VRF->MASTER import-rib inet.0
set routing-options rib-groups MASTER->VRF import-rib inet.0
set routing-options rib-groups MASTER->VRF import-rib 901-Data.inet.0
set routing-options router-id 10.99.99.40

Best Regards
Andreas

6 REPLIES 6
Highlighted
Ethernet Switching

Re: EX3300/3400 - Change Primary interface (instead of lo0)

[ Edited ]
‎06-26-2020 05:49 AM

Hello Andreas:

 

Have you tried using the preferred option. According to documentation:

An interface’s primary address is used by default as the local address for broadcast and multicast packets sourced locally and sent out through the interface. An interface’s preferred address is the default local address used for packets sourced by the local router or switch to destinations on the subnet. By default, the numerically lowest local address configured for the interface is chosen as the preferred address on the subnet.

 

To configure a different primary address or preferred address, include the primary or preferred statement at the [edit interfaces interface-name unit logical-unit-numberfamily family address address or [edit logical-systems logical-system-nameinterfaces interface-name unit logical-unit-number family family addressaddress hierarchy levels.

 

Source: https://www.juniper.net/documentation/en_US/junos/topics/reference/configuration-statement/default-a...

 

Regards 

 

Highlighted
Ethernet Switching

Re: EX3300/3400 - Change Primary interface (instead of lo0)

‎06-26-2020 11:58 AM

Hi Andreas,

 

in simple terms, Preferred address is used when destined to same subnet and Primary adddress - when destined to different subnet.

 

i think that this may help, first mark the address x.x.x.x/32 as primary in the loopback where you want it to be used, second: 

 add following line to the config

set system default-address-selection

Description

Use the loopback interface, lo0, as the source address for all locally generated IP packets when the packet is sent through a routed interface, and also when the packet is sent through a local interface such as fxp0. The lo0 interface is the interface to the router's or switch's Routing Engine.

Default

The default address is used as the source address for all locally generated IP packets on outgoing interfaces that are unnumbered. If an outgoing interface is numbered, the default address is chosen using the following sequence:

 

https://www.juniper.net/documentation/en_US/junos/topics/reference/configuration-statement/default-a...

 

Hope it helps,

 

Cheers, 

Benjamin

Highlighted
Ethernet Switching

Re: EX3300/3400 - Change Primary interface (instead of lo0)

[ Edited ]
‎06-26-2020 11:59 AM

Hi Andreas,

 

If you have "default-address-selection" configured under the [edit systems] hierarchy, then all of the locally generated packets by the router will source traffic using its loopback (lo0) interface address.

 

However, if you prefer to source traffic from a different IP address for a certain protocol such as syslog, radius etc. This can be achieved by configuring a specific source address for it. Below is an example, that shows the source address, the router, will use to send traffic to the syslog server:

 

[edit system syslog]
source-address source-address;

 

Below is a link that describes the scope of the default-address-selection command:

 

https://www.juniper.net/documentation/en_US/junos/topics/reference/configuration-statement/default-a...

 

HTH
B

Kudos are always appreciated. Please mark solution as accepted if it help solves your issue.
Thanks,
B
Highlighted
Ethernet Switching

Re: EX3300/3400 - Change Primary interface (instead of lo0)

‎06-27-2020 03:01 AM

The  operational commands from the cli are going to use what the device feels is the best ip address to establish the ftp, ssh or other outbound connection based on the interface facing where the packet will exit the router in the default or base routing instance.

 

You can override this by adding source and the ip address you want to use or by specifying a routing-instance outside the default.

 

For other protocols configured on the device like syslog these will default to loopback if configured and have to be overridden in configuration per protocol as well.

 

Steve Puluka BSEET - Juniper Ambassador
IP Architect - DQE Communications Pittsburgh, PA (Metro Ethernet & ISP)
http://puluka.com/home
Highlighted
Ethernet Switching

Re: EX3300/3400 - Change Primary interface (instead of lo0)

‎06-29-2020 10:49 AM

Hello, thanks for you response.

I added a new IP to the lo0 and marked it as primary, and configured the -default-address-selection.

But even with that i still see the following:
------------------------

show interfaces lo0
Physical interface: lo0, Enabled, Physical link is Up
Interface index: 6, SNMP ifIndex: 6
Type: Loopback, MTU: Unlimited
Device flags : Present Running Loopback
Interface flags: SNMP-Traps
Link flags : None
Last flapped : Never
Input packets : 10347840
Output packets: 10347840

Logical interface lo0.0 (Index 563) (SNMP ifIndex 16)
Flags: SNMP-Traps Encapsulation: Unspecified
Input packets : 0
Output packets: 0
Protocol inet, MTU: Unlimited
Max nh cache: 0, New hold nh limit: 0, Curr nh cnt: 0, Curr new hold cnt: 0,
NH drop cnt: 0
Flags: Sendbcast-pkt-to-re
Addresses, Flags: Is-Default Is-Primary
Local: 10.99.99.40

Logical interface lo0.16385 (Index 545) (SNMP ifIndex 22)
Flags: SNMP-Traps Encapsulation: Unspecified
Input packets : 10347137
Output packets: 10347137
Protocol inet, MTU: Unlimited
Max nh cache: 0, New hold nh limit: 0, Curr nh cnt: 0, Curr new hold cnt: 0,
NH drop cnt: 0
Flags: None

------------------------------

 

 

And when removing the IP:


root@HOST-SW01> show interfaces lo0
Physical interface: lo0, Enabled, Physical link is Up
Interface index: 6, SNMP ifIndex: 6
Type: Loopback, MTU: Unlimited
Device flags : Present Running Loopback
Interface flags: SNMP-Traps
Link flags : None
Last flapped : Never
Input packets : 10351717
Output packets: 10351717

Logical interface lo0.0 (Index 563) (SNMP ifIndex 16)
Flags: SNMP-Traps Encapsulation: Unspecified
Input packets : 0
Output packets: 0
Protocol inet, MTU: Unlimited
Max nh cache: 0, New hold nh limit: 0, Curr nh cnt: 0, Curr new hold cnt: 0, NH drop cnt: 0
Flags: Sendbcast-pkt-to-re

Logical interface lo0.16385 (Index 545) (SNMP ifIndex 22)
Flags: SNMP-Traps Encapsulation: Unspecified
Input packets : 10351012
Output packets: 10351012
Protocol inet, MTU: Unlimited
Max nh cache: 0, New hold nh limit: 0, Curr nh cnt: 0, Curr new hold cnt: 0, NH drop cnt: 0
Flags: None


It doesnt seem to work..

Highlighted
Ethernet Switching

Re: EX3300/3400 - Change Primary interface (instead of lo0)

‎06-29-2020 10:55 AM

Hi Spluka,

Yes adding the options for 'source-adress' and 'routing-instance' does help my problem with certain configuration like radius and etc.

But i cant seeem to get it working with NTP, and archival-site with FTP.

All i would want is to be able to configure a new MGMT vlan which uses it IP as default source adress, it must be possible to overwrite the routing-instance/lo0?

For instance, if i configure a vlan/irb with a low unit number it outranks the default 101 vlan and since there is no lo0 configured it works, and i dont understand why it doesnt work as is with the ISP loopback adress which has been given to us and is the router ID. the lo0 interface is in the inet.0 but if i write following "ping <HOST> source 10.99.99.40 it cant assign the adress, if i specify the routing-instance with the IP 10.99.99.40 as the router-id it works "ping <HOST> routing-instance 901>"

 

 

Feedback