Junos OS


This community is currently under full moderation, meaning  all posts will be reviewed before appearing in the community. Please expect a brief delay—there is no need to post multiple times. If your post is rejected, you'll receive an email outlining the reason(s). We've implemented full moderation to control spam. Thank you for your patience and participation.

Routing multiple subnets over the same external interface

  • 1.  Routing multiple subnets over the same external interface

    Posted 08-17-2021 15:21

    Dear Juniperians,

    It has been a while since I've touched a Junos device but I'm happy to say most of it feels like riding a bike. Especially when you've learned it the hard (CLI) way.

    At this moment I'm looking at a SRX240 running the latest Junos version. We have one ISP uplink configured at this moment there will be a second uplink in the near future but we have to start somewhere.  We have two ASNs configured on the SRX. Both ASNs have their own public routable subnet. The BGP part is working fine but now comes the routing part.

    The subnet for ASN1 is configured on the external interface:

    ge-0/0/15 {
    unit 0 {
    family inet {
    mtu 1500;
    address SUBNET1/29;
    family inet6 {
    mtu 1500;
    address SUBNET1/120;

    The subnet for ASN2 is configured on a VLAN because we want to assign these IP addresses to machines behind that VLAN directly without using NAT:
    vlan {
    unit 10 {
    family inet {
    address SUBNET2/24;
    family inet6{
    address SUBNET2/29;

    I have assigned a couple of machines with a public IP from SUBNET2. Routing over interface 15 works fine and I'm able to ping outside. The only issue is that when I do a curl on something like IPinfo I get the IP from SUBNET1/ASN1 back instead of the external IP I've configured from the SUBNET2 block.

    Should I switch interface 15 to ethernet-switching or apply some other kind of routing setting to make sure traffic from SUBNET2 is properly routed to and from SUBNET2?

    Many thanks!