28.06.2014 Views

Discussion

Discussion

Discussion

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

you just want to ping Bellagio, it’s nice to have an lo0 address around to which to<br />

assign the ping request. Also, when you save system logfiles on a remote log server, syslog<br />

does a reverse lookup on the log’s source address. If you don’t use lo0 as the source<br />

address, the logfile entries would start with the interface name, such as venus-fe-0-0-<br />

0, instead of the router’s name and would be much harder to read and interpret.<br />

For some applications, including NTP and ping, you can explicitly set the source<br />

address to include in IP packet headers. For a router acting as an NTP time server,<br />

the set system ntp source-address command specifies the address to use in the<br />

router’s responses to NTP client requests. The ping command source option includes<br />

a source address to be used by the ping responses.<br />

See Also<br />

Recipe 7.3<br />

7.5 Configuring an IPv4 Address on an Interface<br />

Problem<br />

You want to configure an interface to work on an IPv4 network.<br />

Solution<br />

Use the following command to configure an IPv4 address on an interface:<br />

[edit]<br />

aviva@router1# set interfaces fe-0/0/0 unit 0 family inet address 192.168.220.1/24<br />

<strong>Discussion</strong><br />

For any IPv4 routing protocol such as BGP, OSPF, RIP, and ICMP to work, not only<br />

do you have to configure the protocol, but you also have to configure the interfaces<br />

on which the protocol can run. You configure the address under the logical interfaces<br />

portion. For IPv4 addresses, the address family is inet.<br />

To see that the IPv4 address has been set, you can look at the logical interface:<br />

aviva@router1> show interfaces fe-0/0/0.0 brief<br />

Logical interface fe-0/0/0.0<br />

Flags: SNMP-Traps Encapsulation: ENET2<br />

inet 192.168.220.1/24<br />

The JUNOS software allows more than one address on a logical interface. Issuing a<br />

second set command does not overwrite an existing address, but simply adds the<br />

second address. To correct an IP address, use the rename command:<br />

[edit interfaces fe-0/0/0]<br />

aviva@router1# rename unit 0 family inet address 192.168.220.1/24 to address 192.168.<br />

220.2/24<br />

206 | Chapter 7: Router Interfaces<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!