Configuring Ethernet Interfaces

Problem

Your router has an Ethernet interface and you want to configure it.

Solution

Use the following command to activate a Fast Ethernet interface:

	[edit interfaces]
	aviva@router1# set fe-0/0/3 unit 0 family inet address 192.168.220.13/24

Use the following commands to activate a Gigabit Ethernet interface:

	[edit interfaces]
	aviva@M5# set ge-0/2/0 unit 0 family inet6 address 3010::2/64
	aviva@M5# set ge-0/2/0 unit 0 family iso

 

Discussion

The basic configuration for Ethernet interfaces is very straightforward. Just assign the desired addresses, and the interface is up and running. Here, for the Fast Ethernet interface, we configure an IPv4 address, and for the Gigabit Ethernet interface, we configure an IPv6 address and the iso family (for IS-IS). You can also configure other address families depending on the protocols that the interface needs to support.

With this configuration, the show interfaces output displays the default JUNOS settings for Ethernet interfaces. The Fast Ethernet defaults are highlighted:

	aviva@router1> show interfaces fe-0/0/3
	Physical interface: fe-0/0/3, Enabled, Physical link is Up
	 Interface index: 131, SNMP ifIndex: 82
	 Link-level type: Ethernet, MTU: 1514, Speed: 100mbps, Loopback: Disabled,
	 Source filtering: Disabled, Flow control: Enabled
	 Device flags : Present Running
	 Interface flags: SNMP-Traps 16384
	 Link flags : 4
	 CoS queues : 4 supported
	 Current address: 00:05:85:02:a4:03, Hardware address: 00:05:85:02:a4:03
	 Last flapped : 2005-05-12 14:58:08 PDT (04:58:52 ago)
	 Input rate : 0 bps (0 pps)
	 Output rate : 0 bps (0 pps)
	 Active alarms : None
	 Active defects : None

	 Logical interface fe-0/0/3.0 (Index 69) (SNMP ifIndex 87)
	 Flags: SNMP-Traps Encapsulation: ENET2
	 Protocol inet, MTU: 1500
	 Flags: None
	 Addresses, Flags: Is-Preferred Is-Primary
	 Destination: 192.168.220.12/24, Local: 192.168.220.13,
	 Broadcast: 192.168.220.255
	 Protocol iso, MTU: 1497
	 Flags: None

The Gigabit Ethernet defaults are the same except for the link speed:

	aviva@M5> show interfaces ge-0/2/0
	Physical interface: ge-0/2/0, Enabled, Physical link is Up
	 Interface index: 134, SNMP ifIndex: 29
	 Link-level type: Ethernet, MTU: 1514, Speed: 1000mbps, Loopback: Disabled,
	 Source filtering: Disabled, Flow control: Enabled
	 Device flags : Present Running
	 Interface flags: SNMP-Traps 16384
	 Link flags : None
	 CoS queues : 4 supported
	 Current address: 00:90:69:69:6c:3e, Hardware address: 00:90:69:69:6c:3e
	 Last flapped : 2005-05-16 16:11:53 PDT (3d 01:07 ago)
	 Input rate : 456 bps (0 pps)
	 Output rate : 0 bps (0 pps)
	 Active alarms : None
	 Active defects : None

	 Logical interface ge-0/2/0.0 (Index 66) (SNMP ifIndex 22)
	 Flags: SNMP-Traps Encapsulation: ENET2
	 Protocol iso, MTU: 1497
	 Flags: Is-Primary
	 Protocol inet6, MTU: 1500
	 Flags: Is-Primary
	 Addresses, Flags: Is-Preferred Is-Primary
	 Destination: 3010::/64, Local: 3010::2
	 Addresses, Flags: Is-Preferred
	 Destination: fe80::/64, Local: fe80::290:69ff:fe69:6c3e

For both types of interfaces, the family MTU size is the default for that family (1,500 bytes for IPv4 and IPv6, and 1,497 bytes for ISO).

Source filtering, off by default, is a security feature for accepting traffic only from a specific MAC interface and rejecting all other traffic. If you want to enable it, set in on the physical interface:

	[edit interfaces fe-0/0/2 fastether-options]
	aviva@router1# set source-filtering
	aviva@router1# set source-address-filter 00:05:85:02:38:02

Flow control, which is enabled by default, allows the receiving devices on the link to detect when they are experiencing congestion and notify their neighboring devices of this. The neighboring devices can moderate the flow of traffic to reduce or eliminate the congestion.

One interface default not shown in the output is whether the interface operates full duplex or half duplex. By default, Fast Ethernet interfaces run in full-duplex mode. You can configure half-duplex mode with the following command:

	[edit interfaces fe-0/0/3]
	aviva@router1# set link-mode half-duplex

Gigabit Ethernet interfaces operate only full duplex. For interoperability the remote end of the link must also be full duplex.

Each Ethernet interface has a Layer 2 MAC address that is hard-coded on the hardware, and this is the default MAC address used for the interface:

	Current address: 00:05:85:02:a4:03, Hardware address: 00:05:85:02:a4:03

There may be security or other reasons to change this hard-coded address, which you can do with following command

	[edit interfaces fe-0/0/3]
	aviva@router1# set mac 00.11.22.33.44.55.66

Checking in the show interfaces command output again, you see that the interface's MAC address is now different from its hardware address:

	Current address: aa:bb:cc:dd:ee:ff, Hardware address: 00:05:85:02:a4:03

The show interfaces command output displays the IPv4 broadcast address, here 192.168.220.255. This is the default broadcast address, in which the host portion of the subnet (which is 192.168.220.12/24) is set to all ones (for a /24 network, the last 8 bits of the address are ones, which is 255 in decimal).

Both the physical and logical interfaces have encapsulations. The default for both is Ethernet II (RFC 894).

The physical interface shows the encapsulation in the Link-level type field, and the logical interface shows it in the Encapsulation field:

	Physical interface: fe-0/0/3, Enabled, Physical link is Up
	 Interface index: 131, SNMP ifIndex: 82
	 Link-level type: Ethernet, MTU: 1514, Speed: 100mbps, Loopback: Disabled,

	Logical interface fe-0/0/3.0 (Index 69) (SNMP ifIndex 87)
	 Flags: SNMP-Traps Encapsulation: ENET2

The JUNOS software supports IEEE 802.1Q VLAN tagging on Ethernet interfaces, which channelizes an Ethernet interface, allowing it to carry traffic from different Ethernet segments over the same physical link but keeping the traffic on separate logical interfaces. VLAN tagging works on an entire physical Ethernet interface, and you configure each logical interface to carry traffic from different Ethernet segments, as shown in this example:

	[edit interfaces fe-2/1/2]
	aviva@router1# set vlan-tagging
	aviva@router1# set unit 0 vlan-id 0
	aviva@router1# set unit 0 family inet address 10.10.1.0/24
	aviva@router1# set unit 1 vlan-id 1
	aviva@router1# set unit 1 family inet address 10.10.1.1/24
	aviva@router1# set unit 2 vlan-id 0
	aviva@router1# set unit 2 family inet address 10.10.1.2/24

You see the VLAN configuration parameters in the logical portion of the show interfaces command output:

	aviva@router1# show interfaces fe-2/1/2.2
	 Logical interface fe-2/1/2.2 (Index 75) (SNMP ifIndex 214)
	 Flags: SNMP-Traps 16384 VLAN-Tag [ 0x8100.2 ] Encapsulation: ENET2
	 Input packets : 0
	 Output packets: 1
	 Protocol inet, MTU: 1500
	 Flags: None
	 Addresses, Flags: Is-Preferred Is-Primary
	 Destination: 10.10.1/24, Local: 10.10.1.2, Broadcast: 10.10.1.255



Router Configuration and File Management

Basic Router Security and Access Control

IPSec

SNMP

Logging

NTP

Router Interfaces

IP Routing

Routing Policy and Firewall Filters

RIP

IS-IS

OSPF

BGP

MPLS

VPNs

IP Multicast



JUNOS Cookbook
Junos Cookbook (Cookbooks (OReilly))
ISBN: 0596100140
EAN: 2147483647
Year: 2007
Pages: 290
Authors: Aviva Garrett

Similar book on Amazon

Flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net