0

enter image description here

I want to make 4 PC got DHCP IP address No problem with left side, but right side 2 PC can't get IP automaitic. I think the problem is DHCP Relay. How can I use ip helper-address for subinterface of R2?

s1

 interface FastEthernet0/1
   switchport mode trunk
 interface FastEthernet0/2
   switchport access vlan 11
   switchport mode access
 interface FastEthernet0/3
   switchport access vlan 10
   switchport mode access

s2

 interface FastEthernet0/1
   switchport mode trunk
 interface FastEthernet0/2
   switchport access vlan 20
   switchport mode access
 interface FastEthernet0/3
   switchport access vlan 30
   switchport mode access

R1-DHCP

1.Building configuration...

Current configuration : 1593 bytes
!
version 15.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
ip dhcp pool Area-1
 network 192.168.11.0 255.255.255.0
 default-router 192.168.11.1
ip dhcp pool Area-2
 network 192.168.10.0 255.255.255.0
 default-router 192.168.10.1
ip dhcp pool Area-3
 network 192.168.20.0 255.255.255.0
 default-router 192.168.20.1
ip dhcp pool Area-4
 network 192.168.30.0 255.255.255.0
 default-router 192.168.30.1
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface GigabitEthernet0/0/0
 ip address 190.168.50.1 255.255.255.0
 duplex auto
 speed auto
!
interface GigabitEthernet0/0/0.20
 encapsulation dot1Q 20
 ip address 192.168.20.1 255.255.255.0
!
interface GigabitEthernet0/0/0.30
 encapsulation dot1Q 30
 ip address 192.168.30.1 255.255.255.0
!
interface GigabitEthernet0/0/1
 no ip address
 duplex auto
 speed auto
!
interface GigabitEthernet0/0/1.10
 encapsulation dot1Q 10
 ip address 192.168.10.1 255.255.255.0
!
interface GigabitEthernet0/0/1.11
 encapsulation dot1Q 11
 ip address 192.168.11.1 255.255.255.0
!
interface GigabitEthernet0/0/2
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
router rip
 version 2
 network 192.168.20.0
 network 192.168.30.0
 network 192.168.50.0
 no auto-summary
!
ip classless
ip route 192.168.20.0 255.255.255.0 192.168.50.2 
ip route 192.168.30.0 255.255.255.0 192.168.50.2 
!
ip flow-export version 9
!
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end

R2

Building configuration...

Current configuration : 1151 bytes
!
version 15.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface GigabitEthernet0/0/0
 ip address 192.168.50.2 255.255.255.0
 ip helper-address 192.168.50.1
 duplex auto
 speed auto
!
interface GigabitEthernet0/0/1
 no ip address
 duplex auto
 speed auto
!
interface GigabitEthernet0/0/1.20
 encapsulation dot1Q 20
 ip address 192.168.20.1 255.255.255.0
 ip helper-address 192.168.50.1
!
interface GigabitEthernet0/0/1.30
 encapsulation dot1Q 30
 ip address 192.168.30.1 255.255.255.0
 ip helper-address 192.168.50.1
!
interface GigabitEthernet0/0/2
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
router rip
 version 2
 network 192.168.10.0
 network 192.168.11.0
 network 192.168.50.0
 no auto-summary
!
ip classless
ip route 192.168.10.0 255.255.255.0 192.168.50.1 
ip route 192.168.11.0 255.255.255.0 192.168.50.1 
!
ip flow-export version 9
2
  • The command is ip helper-address but we would really need to see the network device configurations, and you must have routing properly configured. Please edit you question to include all the configurations.
    – Ron Maupin
    Mar 13, 2022 at 1:46
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can post and accept your own answer.
    – Ron Maupin
    Nov 19, 2022 at 23:09

2 Answers 2

0

this should be configured via R2.

ip dhcp pool Area-3
 network 192.168.20.0 255.255.255.0
 default-router 192.168.20.1
ip dhcp pool Area-4
 network 192.168.30.0 255.255.255.0
 default-router 192.168.30.1
3
  • In that case, won't R2 become a DHCP server? My goal is that R1 is a DHCP server. Mar 14, 2022 at 11:41
  • Have you check if you have properly advertised network on R1 and R2 ? From R1 the network should be advertised network 192.168.10.0 and 192.168.11.0 .
    – dlareg28
    Mar 14, 2022 at 12:37
  • How to check that? Mar 15, 2022 at 0:34
0

Some issues:

  • ip helper-address 192.168.50.2 You've added the router itself as DHCP server. That line needs to go.
  • There's no DHCP relay set up for VLAN 30.
  • Add static routes for the remote networks on each router. As it is, each router only sees the immediately attached networks. Lacking a route, packets for the other networks are dropped.
  • Currently, you've got subinterfaces for VLAN 20 and 30 on R1/Gig0.0.0 (towards R2). That can't work as there's no L2 connectivity across R2. At the same time, the DHCP relay won't work for (seemingly) directly attached IP subnets; also routing won't work properly. You need to remove those subinterfaces.
4
  • R2:S 192.168.10.0/24 [1/0] via 192.168.50.1 S 192.168.11.0/24 [1/0] via 192.168.50.1 R1: 192.168.20.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.20.0/24 is directly connected, GigabitEthernet0/0/0.20 L 192.168.20.1/32 is directly connected, GigabitEthernet0/0/0.20 192.168.30.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.30.0/24 is directly connected, GigabitEthernet0/0/0.30 L 192.168.30.1/32 is directly connected, GigabitEthernet0/0/0.30 Mar 13, 2022 at 17:01
  • I set up a static route, but the routing situation in R2 doesn't feel quite right to me, is there a problem here? Thanks! Mar 13, 2022 at 17:03
  • If you can ping all IP addresses from anywhere then the routing is working.
    – Zac67
    Mar 13, 2022 at 17:27
  • No, PC3 and PC4 can't get DHCP and R2 can't ping PC1 and PC2. Mar 13, 2022 at 22:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.