You are on page 1of 28

Inter-VLAN Routing

4-1
Copyright 2005 Juniper Networks, Inc.

Proprietary and Confidential

www.juniper.net

Overview of Inter-VLAN Routing


Inter-VLAN routing allows Layer 3
communications between individual subnets
or VLANs
Typically performed at the distribution layer

Inter-VLAN communications require that


interfaces be configured for Layer 3
operation
[edit]
user@switch# show interfaces

vlan {
unit 100 {
family inet {
address 172.19.253.1/24;
}
}
Logical Layer 3 VLAN
}
interface (RVI)

Protocol family determines layer of


operation
Protocol
family inet

2008 Juniper Networks, Inc. All rights reserved.

used for Layer 3


interfaces

Inter-VLAN Routing Example


Use RVIs to allow inter-VLAN
DS1 (Layer 2/3)
communications:
VLAN v100 is
vlan.10010.10.1.1
associated with the
10.10.1.0/24 subnet
VLAN v200 is
associated with the
10.10.2.0/24 subnet

vlan.20010.10.2.1

ge-0/0/10

RVIs function as
gateway for VLANs
v100 and v200

ge-0/0/13

Layer 2 trunk links

AS1 (Layer 2)

Host A
v100
Host B
10.10.1.10
v200
10.10.2.10
2008 Juniper Networks, Inc. All rights reserved.

AS2 (Layer 2)

Host C
Host D
v100
10.10.1.20 v200
10.10.2.20
3

Inter-VLAN Routing Configuration (1 of 2)


Configure Layer 2 and Layer 3 VLAN
[edit]
interfaces:
user@DS1# show interfaces
ge-0/0/10 {
unit 0 {
family ethernet-switching {
port-mode trunk;
vlan {
members [ v100 v200 ];
}
}
}
}
ge-0/0/13 {
unit 0 {
family ethernet-switching {
port-mode trunk;
vlan {
members [ v100 v200 ];
}
}
}
}

2008 Juniper Networks, Inc. All rights reserved.

vlan {
unit 100 {
family inet
address
}
}
unit 200 {
family inet
address
}
}
}

{
10.10.1.1/24;

{
10.10.2.1/24;

RVIs function as
Layer 3 gateway for
v100 and v200

Inter-VLAN Routing Configuration (2 of 2)


Associate Layer 3 VLAN interfaces with
proper VLANs:
[edit]
user@DS1# show vlans
v100 {
vlan-id 100;
l3-interface vlan.100;
}
v200 {
vlan-id 200;
l3-interface vlan.200;
}

2008 Juniper Networks, Inc. All rights reserved.

RVIs are associated with


relevant VLANs to
provide Layer 3 services

EX-series Layer 3 Routing Support


EX-series switches support the following
Layer 3 unicast forwarding mechanisms and
protocols:
Static routing
RIP
OSPF
IS-IS
BGP
VRRP

2008 Juniper Networks, Inc. All rights reserved.

The Routing Table


Compiles information learned from routing
protocols and other routing information
sources
Selects an active route to each destination
Populates the forwarding table
EX-series switches use the inet.0 routing
table for IPv4 unicast routing
Routing
Protocol
OSPF
Other
Databases
Routing
Informatio Direc
Stati
n
t c
Sources

2008 Juniper Networks, Inc. All rights reserved.

Routing
Table

Forwardin
g
Table

Route Preference
Ranks routes received from different sources
Primary criterion for selecting the active
route
Ranges from 0 to 4,294,967,295, with lower
value preferred
Route Preference Values
Routing Information
Source

Default Preference

Direct

Local

Static

OSPF internal

10

RIP

100

OSPF AS external

150

BGP (both EBGP and


IBGP)

170

2008 Juniper Networks, Inc. All rights reserved.

Viewing the Route Table


Use show route to display route table
contents:
user@switch>
show route
inet.0: 6 destinations, 7 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.1.1.0/24

172.18.25.0/30
172.18.25.1/32
172.29.30.0/24
172.29.30.1/32
224.0.0.5/32

2008 Juniper Networks, Inc. All rights reserved.

*[Static/5] 00:10:24
Route source and
> to 172.29.30.253 via ge-0/0/10.0
preference
[OSPF/10] 00:03:38, metric 2
> to 172.18.25.2 via ge-0/0/13.0
*[Direct/0] 00:11:05
> via ge-0/0/13.0
*[Local/0] 00:11:05
Local via ge-0/0/13.0
*[Direct/0] 00:11:05
> via ge-0/0/10.0
*[Local/0] 00:11:05
Local via ge-0/0/10.0
*[OSPF/10] 00:06:55, metric 1
MultiRecv
Asterisk (*) indicates
that the route is
selected as active
9

Static Routes
Manually configured routes added to route table
Defined under [edit routing-options] hierarchy

Always require a configured next hop

Valid options are IP address, discard, and reject

Qualified next-hop option allows independent preference


Static Routing

Distribution Switch

Edge Router
ge-0/0/10

.1

192.168.0.0/30

.2

Service
Provider

user@switch> show route protocol static


inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0.0.0.0/0

A default route
2008 Juniper Networks, Inc. All rights reserved.

*[Static/5] 00:01:07
> to 192.168.0.2 via ge-0/0/10.0

Route source and


preference
Next-hop interface/IP
address
10

Static Routing Case Study


Use static routing to provide connectivity among all
connected subnets and loopback addresses
S1

S2
ge-0/0/10
.1

0/ 2
ge-0/
.1
lo0: 192.168.24.1

10.222.1.0/24

2008 Juniper Networks, Inc. All rights reserved.

10.222.2.0/30

ge-0/0/10
.2

ge0/0
/2
.1
lo0: 192.168.36.1

10.222.3.0/24

11

Default Route Configuration


Create a default route on S1; use S2 as the next
hop
S1

S2
ge-0/0/10
.1

0/ 2
ge-0/
.1
lo0: 192.168.24.1

10.222.2.0/30

ge-0/0/10
.2

ge0/0
/2
.1
lo0: 192.168.36.1

10.222.1.0/24

10.222.3.0/24

Default and static routes are


[edit routing-options]
configured under the [edit routinguser@s1# show
options] hierarchy level
static {
route 0.0.0.0/0 next-hop 10.222.2.2;
}
A default route matches all
destinations when a more specific
route entry does not exist
2008 Juniper Networks, Inc. All rights reserved.

12

Static Route Configuration


Create static routes on S2; use S1 as the next hop
S1

S2
ge-0/0/10
.1

0/ 2
ge-0/
.1
lo0: 192.168.24.1

10.222.2.0/30

ge-0/0/10
.2

ge0/0
/2
.1
lo0: 192.168.36.1

10.222.1.0/24

10.222.3.0/24

[edit routing-options]
user@s2# show
static {
route 10.222.1.0/24 next-hop 10.222.2.1;
route 192.168.24.1/32 next-hop 10.222.2.1;
}

2008 Juniper Networks, Inc. All rights reserved.

13

Monitoring Static Routing


Display the routing table and to confirm
reachability S1
0/ 2
ge-0/
.1

ge-0/0/10
.1

10.222.2.0/30

S2

ge-0/0/10
.2

lo0: 192.168.24.1
10.222.1.0/24

ge0/0
/2
.1

lo0: 192.168.36.1
10.222.3.0/24

user@s1> show route protocol static


inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0.0.0.0/0

*[Static/5] 00:11:33
> to 10.222.2.2 via ge-0/0/10.0

Default static
route is active
on S1

user@s1> ping 10.222.3.1 source 10.222.1.1 count 25 rapid


PING 10.222.3.1 (10.222.3.1): 56 data bytes
Test confirms
!!!!!!!!!!!!!!!!!!!!!!!!!
end-to-end routing
--- 10.222.3.1 ping statistics --25 packets transmitted, 25 packets received, 0% packet loss
round-trip min/avg/max/stddev = 1.215/4.397/35.945/6.451 ms
2008 Juniper Networks, Inc. All rights reserved.

14

OSPF Protocol Overview


OSPF is a link-state routing protocol that:

Reliably floods LSAs to distribute link-state


information
Creates a complete database for the network
Uses the SPF algorithm to calculate best paths
within a network
Uses areas
to Routes
incorporate hierarchy and allow for
Interarea
scalability(Summary Routes)
Backbone
(Area 0)
Area 1

RIP

2008 Juniper Networks, Inc. All rights reserved.

External Routes

BGP

Area 2

Intra-Area Routes

15

OSPF Routers
Area border router:
Any router that belongs to more than one area,
ABRs connect OSPF areas to the OSPF backbone
(Area 0)

Autonomous system boundary router:


Any router that injects routing informationArea
from
border
Interarea
Routes
routers
outside the
OSPF domain into the OSPF domain
(Summary Routes)
Backbone
(Area 0)

Area 2

Area 1

RIP

2008 Juniper Networks, Inc. All rights reserved.

External Routes

Intra-Area Routes

BGP

Autonomous
system
boundary
routers

16

OSPF Areas
Areas:
Single AS can be divided into smaller groups
called areas
Areas can limit the size of the link-state database
Routers maintain identical databases within the
same area
Interarea Routes
ABRs maintain a
Area 0 distributes
(Summary Routes) routing information between
database for each
configured area
other areas
Backbone
(Area 0)

Interarea
communications
typically traverse Area
the2
Area 1
backbone (Area 0)

RIP

2008 Juniper Networks, Inc. All rights reserved.

External Routes

BGP

Intra-Area Routes

17

Sample Single-Area OSPF Topology


OSPF Area 0
S1

S2
ge-0/0/11
.1

0/ 0
ge-0/
.1
lo0: 192.168.24.1

10.222.1.0/24

10.222.2.0/30

ge-0/0/11
.2

ge0/0
/0
.1
lo0: 192.168.36.1

10.222.3.0/24

Use a single OSPF area to provide


connectivity among all connected subnets as
well as loopback addresses

2008 Juniper Networks, Inc. All rights reserved.

18

Sample Single-Area OSPF Configuration


OSPF Area 0
S1

S2
ge-0/0/11
.1

0/ 0
ge-0/
.1
lo0: 192.168.24.1

10.222.1.0/24

[edit protocols ospf]


user@s1# show
area 0.0.0.0 {
interface ge-0/0/0.0;
interface lo0.0;
interface ge-0/0/11.0;
}

2008 Juniper Networks, Inc. All rights reserved.

10.222.2.0/30

ge-0/0/11
.2

ge0/0
/0
.1
lo0: 192.168.36.1

10.222.3.0/24

[edit protocols ospf]


user@s2# show
area 0.0.0.0 {
interface ge-0/0/0.0;
interface lo0.0;
interface ge-0/0/11.0;
}

19

Monitoring OSPF (1 of 3)
Use the show ospf neighbor command to
display adjacencies
Use the detail or extensive keyword for added
information
user@s1> show ospf neighbor
Address
Interface
10.222.2.2
ge-0/0/11.0

State
Full

ID
192.168.36.1

Pri
128

Dead
36

Use the clear ospf neighbor command to


clear adjacencies
Specify individual neighbors or clear all neighbor
user@s1>
clear ospf neighbor ?
adjacencies
Possible completions:
<[Enter]>
Execute this command
<neighbor>
Name of neighbor
|
Pipe through a command
user@s1> clear ospf neighbor
2008 Juniper Networks, Inc. All rights reserved.

20

Monitoring OSPF (2 of 3)
Use the show ospf route command to
display routes learned and advertised into
OSPF
Includes routes for interfaces running OSPF

user@s1> show ospf route


Topology default Route Table:
Prefix
192.168.36.1
10.222.1.0/24
10.222.2.0/24
10.222.3.0/24
192.168.24.1/32
192.168.36.1/32

2008 Juniper Networks, Inc. All rights reserved.

Path
Type
Intra
Intra
Intra
Intra
Intra
Intra

Route
Type
Router
Network
Network
Network
Network
Network

NH
Metric
Type
IP
1
IP
1
IP
1
IP
2
IP
0
IP
1

NextHop
Interface
ge-0/0/11.0
ge-0/0/0.0
ge-0/0/11.0
ge-0/0/11.0
lo0.0
ge-0/0/11.0

Nexthop
addr/label
10.222.2.2
10.222.2.2
10.222.2.2

21

Monitoring OSPF (3 of 3)
Use the show ospf database command to
display link-state database entries
user@s1> show ospf database
OSPF link state database, Area 0.0.0.0
Type
ID
Adv Rtr
Seq
Router *192.168.24.1
192.168.24.1
0x8000000e
Router
192.168.36.1
192.168.36.1
0x8000000d
Network 10.222.2.2
192.168.36.1
0x8000000a

Age
1270
1271
1271

Opt
0x22
0x22
0x22

Cksum Len
0xedcc 60
0xd0c3 60
0xb0f3 32

Self-originated LSAs marked with *

Use the clear ospf database command to


clear the link-state database
user@s1> clear ospf database

2008 Juniper Networks, Inc. All rights reserved.

22

What Is VRRP?
An election protocol used to designate one
of multiple VRRP routers as master
The master VRRP device assumes forwarding
responsibilities for the LAN
Means of incorporating redundancy in a LAN
Typically used in high-availability Ethernet
networks
Defined in RFC 2338

2008 Juniper Networks, Inc. All rights reserved.

23

VRRP Terminology
Virtual routerVirtual entity that functions as the
default router on a LAN; consists of a VRID and an
IP address used as a gateway address known as
the VIP address
VRRP routerAny router participating in VRRP,
including the master and all backup routers
Master routerVRRP router performing packet
forwarding and responding to ARP requests
Backup routerVRRP router available to assume
the role of the master router upon failure

2008 Juniper Networks, Inc. All rights reserved.

24

VRRP Case Study: Sample Topology


S1
User X
(.100/24)

User Y
(.101/24)

13
/0 /
0
ge /24
.2
.3 /
24
ge
-0
/0
/16

ge-0
/0/5
.10
/2

GW=
.1

.1/24
.
.11

/ 24

/0/5
0
e
g

S2

Goals:
Provide a single gateway address on both S1 and S2 for the
10.10.1.0/24 subnet; this common gateway address should
be bound to a Layer 3 VLAN interface for both S1 and S2
Use VRRP to provide redundancy during failure scenarios;
S1 should function as the master during normal operations
2008 Juniper Networks, Inc. All rights reserved.

25

VRRP Case Study: Sample Configuration


Configuration on S1 and S2 to accomplish
S1 Configuration
S2 Configuration
objectives

ge-0/0/13 {
unit 0 {
family ethernet-switching {
port-mode trunk;
vlan {
members all;
}
}
}
}
vlan {
unit 100 {
family inet {
address 10.10.1.2/24 {
vrrp-group 100 {
virtual-address 10.10.1.1;
priority 110;
}
}
}
}
Priority
}

determines
master/backup
state

2008 Juniper Networks, Inc. All rights reserved.

ge-0/0/16 {
unit 0 {
family ethernet-switching {
port-mode trunk;
vlan {
members all;
}
}
}
}
vlan {
unit 100 {
family inet {
address 10.10.1.3/24 {
vrrp-group 100 {
virtual-address 10.10.1.1;
priority 90;
}
}
}
}
}

26

VRRP Case Study: Sample Monitoring


Use the show vrrp command to view VRRP
state information
Use the detail or extensive keywords for added
details
user@s1> show vrrp
Interface
State
vlan.100
up

Group
100

VR state
master

Timer
Type
A 0.232 lcl
vip

Address
10.10.1.2
10.10.1.1

user@s2> show vrrp


Interface
State
vlan.100
up

Group
100

VR state
backup

Timer
Type
D 3.324 lcl
vip
mas

Address
10.10.1.3
10.10.1.1
10.10.1.2

2008 Juniper Networks, Inc. All rights reserved.

27

You might also like