03-02-2017 04:49 AM - edited 03-05-2019 08:07 AM
Hi talents, I have tried with inbound route-map, but it only can change the next-hop address of BGP learned routes to a fixed IP address, rather than dynamic gateway IP address of its DHCP/PPPoE server.
Working fine in Juniper SRX with changing the next-hop IP address to 0.0.0.0, then it would be redirected to the gateway IP address of its DHCP/PPPoE server, but cisco router cannot be set to 0.0.0.0 with inbound route-map, even the command "set ip next-hop dynamic dhcp" cannot be working.
Thanks a lot.
Below is the scenario and configuration.
R1------------R2----------R3(DHCP server)
e0/0 e0/0 e0/1 e0/0
#R1#
interface Loopback0
ip address 22.22.22.22 255.255.255.255
!
interface Ethernet0/0
ip address 10.2.1.2 255.255.255.0
!
router bgp 100
bgp log-neighbor-changes
network 22.22.22.22 mask 255.255.255.255
neighbor 10.2.1.1 remote-as 200
maximum-paths 32
#R2#
interface Ethernet0/0
ip address 10.2.1.1 255.255.255.0
!
interface Ethernet0/1
ip address dhcp
!
router bgp 200
bgp log-neighbor-changes
neighbor 10.2.1.2 remote-as 100
neighbor 10.2.1.2 route-map NEXT-HOP in
maximum-paths 32
!
route-map NEXT-HOP permit 10
set ip next-hop dynamic dhcp
#R3#
ip dhcp pool DHCP
network 10.1.1.0 255.255.255.0
default-router 10.1.1.1
!
interface Loopback0
ip address 22.22.22.22 255.255.255.255
!
interface Ethernet0/0
ip address 10.1.1.1 255.255.255.0
Solved! Go to Solution.
03-03-2017 08:17 AM
Hello Georg
it won't as the ebgp routes are more specific - Pbr or other related statics would work though
res
Paul
03-02-2017 05:37 AM
Hello,
why is the 'set ip next-hop dynamic dhcp' not working ? Which IOS version are you running ?
03-02-2017 07:18 AM
Hi Georg,
I have no idea. I am using IOS 15.4.
03-02-2017 07:23 AM
Hello,
can you post your config ? I want to lab this in GNS3...
03-02-2017 07:45 AM
R1------------R2----------R3(DHCP server)
e0/0 e0/0 e0/1 e0/0
#R1#
interface Loopback0
ip address 22.22.22.22 255.255.255.255
!
interface Ethernet0/0
ip address 10.2.1.2 255.255.255.0
!
router bgp 100
bgp log-neighbor-changes
network 22.22.22.22 mask 255.255.255.255
neighbor 10.2.1.1 remote-as 200
maximum-paths 32
#R2#
interface Ethernet0/0
ip address 10.2.1.1 255.255.255.0
!
interface Ethernet0/1
ip address dhcp
!
router bgp 200
bgp log-neighbor-changes
neighbor 10.2.1.2 remote-as 100
neighbor 10.2.1.2 route-map NEXT-HOP in
maximum-paths 32
!
route-map NEXT-HOP permit 10
set ip next-hop dynamic dhcp
#R3#
ip dhcp pool DHCP
network 10.1.1.0 255.255.255.0
default-router 10.1.1.1
!
interface Loopback0
ip address 22.22.22.22 255.255.255.255
!
interface Ethernet0/0
ip address 10.1.1.1 255.255.255.0
03-02-2017 11:25 PM
Hello,
I have spent the last few hours debugging and trying to find out why the dynamic dhcp doesn't work in the route map, really without any result. I have read somewhere that a T release is required for this command to work properly, I'll try and find a router that runs that release and test further...
03-02-2017 11:51 PM
Hi Georg,
Really appreciate for your kind help!!
03-03-2017 05:42 AM
Hello
R1-R2 are ebgp peering and R2 is also receiving an dynamic addressing from R3.
If you trying to change R2's default next hop to point towards R3 using this command then as Georg as stated it seems to require a certain IOS version but I am to which one as I have tested this 15.1(4) is it still doesn't seem to work.
However it doesn't stop you using a different method, You could use a default static route with a lower admin distance than the default of 254 obtained from dhcp.
Note:if the same networks are being advertised more specifically,Then either a PBR with a named next hop would be required or other statics.
ip route 0.0.0.0 0.0.0.0 eth0/0 dhcp 1
res
Paul
03-03-2017 07:05 AM
Hi Paul,
Thanks for your reply, but I cannot understand why using a default static route with a lower admin distance than the default of 254 obtained from dhcp.
I just want to do the below task.
R2#show ip rou
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is 10.1.1.1 to network 0.0.0.0
S* 0.0.0.0/0 [254/0] via 10.1.1.1
10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C 10.1.1.0/24 is directly connected, Ethernet0/1
L 10.1.1.3/32 is directly connected, Ethernet0/1
C 10.2.1.0/24 is directly connected, Ethernet0/0
L 10.2.1.1/32 is directly connected, Ethernet0/0
22.0.0.0/32 is subnetted, 1 subnets
B 22.22.22.22 [20/0] via 10.2.1.2, 00:00:41
change to
B 22.22.22.22 [20/0] via 10.1.1.1, 00:00:41
Thanks.
03-03-2017 07:47 AM
Just to chip in (as I pretty much tested all commands available yesterday), the command:
ip dhcp-client default-router distance 1
changes the static default generated by DHCP to an AD of 1, but still does not affect the behavior of the route map...
S* 0.0.0.0/0 [1/0] via 10.1.1.1
10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C 10.1.1.0/24 is directly connected, FastEthernet0/1
L 10.1.1.10/32 is directly connected, FastEthernet0/1
C 10.2.1.0/24 is directly connected, FastEthernet0/0
L 10.2.1.1/32 is directly connected, FastEthernet0/0
22.0.0.0/32 is subnetted, 1 subnets
B 22.22.22.22 [20/0] via 10.2.1.2, 05:18:36
03-03-2017 08:17 AM
Hello Georg
it won't as the ebgp routes are more specific - Pbr or other related statics would work though
res
Paul
03-03-2017 02:06 PM
You are right.
I did some more testing, on an IOS T version, but no difference. I am starting to think that this is either a bug, or, which is more likely, that 'dynamic dhcp' does not work with BGP related route maps. I haven't tested on Denali, or XR, or XE, though.
I don't have a service contract, so I cannot report a bug. If you, Paul or hunterlau, do have one, can you report a bug, or bettter yet, open a TAC case ?
03-03-2017 08:17 AM
Hello
Because your only default route via dhcp has an admin distance of 254 and those ebgp prefixes are more specific and have a lower admin distance
you can try either:
use a lower default static route for all traffic (only if you already using a default with a lower admin but again it still won't work on more specific routes)
pbr via a specific ip next hop address (not dynamic dhcp command as this doesn't seem to work)
Use other conditional specific statics routes
res
paul
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide