12-07-2015 09:08 AM - edited 03-05-2019 02:53 AM
Hello
I am facing an architecture issue:
I am cascading a CISCO Router (892FSP, running IOS 15.2.4M8)) behind a Internet Box, this Internet Box is serving ip address/mask/default router dynamically thank to DHCP server (I have no access to configuration of this Internet Box).
My CISCO router has only 2 interfaces:
- 1 connected to the Internet box (lets call it the WAN interface)
- 1 connected to host (lets call it the LAN interface)
I would like to :
- retrieve dynamically an ip address+mask on my WAN interface: so far, it is easy with "ip address dhcp"
- prevent the CISCO router to install a default route to the DHCP router (DHCP option 3)
- install manually a static route /32 with next-hop = DHCP router
I tried to configure : "no ip dhcp client request router" on the DHCP interface, it removes DHCP option 3 from the DHCP Discover request, it prevents the router from installing the default route, but in the meanwhile, it prevent me from using commande "ip route A.B.C.D 255.255.255.255 dhcp", I really would like to keep dynamicity of DHCP, I need a generic configuration.
Any idea, remarks are welcome.
Thanks
Alex
12-07-2015 11:08 AM
To load the /32 use a command like:
ip route a.b.c.d 255.255.255.255 DHCP
The "DHCP" keyword says to use the DHCP next-hop address address.
12-08-2015 12:45 AM
Hello,
Thanks for your reply, but the main issue is the following:
I expect to have in my routing table following routes: (see following code)
- assuming 192.168.1.1 is the next-hop of my default route learnt with DHCP
- 192.168.1.129 is the address assigned by my DHCP server
NR-892FSP-1#sh ip route
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
+ - replicated route, % - next hop override
Gateway of last resort is not set
A.0.0.0/32 is subnetted, 1 subnets
S A.B.C.D [1/0] via 192.168.1.1
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet8
L 192.168.1.129/32 is directly connected, GigabitEthernet8
.....................
...................
!
interface GigabitEthernet8
ip address dhcp
load-interval 30
duplex auto
speed auto
end
!
ip route A.B.C.D 255.255.255.255 dhcp
!
Here is the routing table after DHCP process completes:
NR-892FSP-1#sh ip route
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
+ - replicated route, % - next hop override
Gateway of last resort is 192.168.1.1 to network 0.0.0.0
S* 0.0.0.0/0 [254/0] via 192.168.1.1
1.0.0.0/32 is subnetted, 1 subnets
S 1.1.1.1 [1/0] via 192.168.1.1
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet8
L 192.168.1.129/32 is directly connected, GigabitEthernet8
But I don't want the gateway of last resort to be set
!
interface GigabitEthernet8
no ip dhcp client request router
ip address dhcp
load-interval 30
duplex auto
speed auto
end
!
ip route A.B.C.D 255.255.255.255 dhcp
!
the new CLI command ask the router to not request the DHCP option 3 (router).
NR-892FSP-1#sh ip route
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
+ - replicated route, % - next hop override
Gateway of last resort is not set
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet8
L 192.168.1.129/32 is directly connected, GigabitEthernet8
In this case I have neither the default route nor the host route
I would like the router to:
- request for the DHCP option 3
- do not install the gateway of last resort
- allow to use DHCP keyword for manual static route
Thanks for comments.
Alex
12-08-2015 01:17 PM
I can give you close to what you want. First change the administrative distance for DHCP routes.
ip dhcp-client default-router distance 200
Now add a default route to Null0, so traffic is biffed - or if you have any other default route it will take precendence (assuming its cost is less than 200).
ip route 0.0.0.0 0.0.0.0 Null0
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