Jan 7, 2015

peer default ip address

Hello everyone.

In this post, i will introduce "peer default ip address". 

To return an IP address from a remote pear, we can use the command "peer default ip address".

--------------------------
// Topology //

R1[S1/0]    -----  [S1/0] R2


// Basic config //

[On R1]
interface Serial0/0
 no ip address
 encapsulation ppp

[On R2]
interface Serial0/1
 ip address 192.168.12.2 255.255.255.0
 encapsulation ppp
--------------------------


As you can see, there are for options for this commands

R1(config-if)#peer default ip address ?
  A.B.C.D    Default IP address for remote end of this interface
  dhcp       Use DHCP proxy client mechanism to allocate a peer IP address
  dhcp-pool  Use local DHCP pools to allocate a peer IP address
  pool       Use IP pool mechanism to allocate a peer IP address


In this post, I will "A.B.C.D", "dhcp-pool" and "pool"


// A.B.C.D//
To assign an IP address from a remote peer by static.


[R1]
interface Serial0/0
 ip address negotiated

[R2]
interface Serial0/1
 peer default ip address 192.168.12.1

After you can shut and no shut the inteface (s1/0) on R2
R2(config-if)#shut
*Mar  1 00:21:31.555: %LINK-5-CHANGED: Interface Serial1/0, changed state to administratively down
*Mar  1 00:21:32.555: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to down
R2(config-if)#no shut
*Mar  1 00:21:41.199: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up
*Mar  1 00:21:42.259: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up

Then, you can see that R1 gets an IP address from remote peer R2. 

R1(config-if)#do sh ip interface s1/0
Serial0/0 is up, line protocol is up
  Internet address is 192.168.12.1/32
  Broadcast address is 255.255.255.255
  Address determined by IPCP
  Peer address is 192.168.12.2



// dhcp-pool //


R1(config)#int s1/0
R1(config-if)#ip address negotiated


define a dhcp pool on R2
R2(config)#ip dhcp pool R2
R2(dhcp-config)#network 192.168.12.0 /24

R2(config)#ip dhcp excluded-address 192.168.12.0 192.168.12.10

interface Serial1/0
 ip address 192.168.12.2 255.255.255.0
 encapsulation ppp
 peer default ip address dhcp-pool R2
 serial restart-delay 0

Now, you can "no shut" the interface S1/0 on R2,  R1 will get the IP address from R2's DHCP pool. To confirm it, inputting "show ip int bri" on R1, you will see as following 

R1(config-if)#do sh ip int bri
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        unassigned      YES unset  administratively down down
Serial1/0              192.168.12.11   YES IPCP   up                    up



// pool //


R1(config)#int s1/0
R1(config-if)#ip address negotiated

define a local pool on R2
R2(config)#ip local pool default 192.168.12.20 192.168.12.30

interface Serial1/0
 ip address 192.168.12.2 255.255.255.0
 encapsulation ppp
 peer default ip address pool
 serial restart-delay 0

The result will be like this 

R1(config-if)#do sh ip int bri
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        unassigned      YES unset  administratively down down
Serial1/0              192.168.12.20   YES IPCP   up                    up


See you next time and Good Luck !!

Reference 
1.
http://www.cisco.com/c/en/us/td/docs/ios/dial/command/reference/dia-cr-book/dia_p1.html

No comments:

Post a Comment