Options

dhcp problem

newman555newman555 Member Posts: 26 ■□□□□□□□□□
Hi! I have a little problem, so I hope you guys can help...

For example, I have a network with two routers, R1 and R2. R1 has a lan (192.168.1.0/24) and I want to use R1 as a relay agent. I want R2 to be my dhcp server.

LAN----192.168.1.0/24----R1--192.168.2.0/24--R2(dhcp)

What wrong with this config?
R1:
int fa0/0
ip add 192.168.1.1 255.255.255.0
ip helper-address 192.168.2.2
int fa0/1
ip add 192.168.2.1 255.255.255.0

R2:
ip dhcp pool LAN
network 192.168.1.0
default-router 192.168.1.1
int fa0/0
ip add 192.168.2.2 255.255.255.0

Did I miss some basics here, so that's the reason this couldn't possibly work or what? Thank you!

Comments

  • Options
    elphrank0elphrank0 Member Posts: 67 ■■□□□□□□□□
    newman555 wrote: »
    Hi! I have a little problem, so I hope you guys can help...

    For example, I have a network with two routers, R1 and R2. R1 has a lan (192.168.1.0/24) and I want to use R1 as a relay agent. I want R2 to be my dhcp server.

    LAN----192.168.1.0/24----R1--192.168.2.0/24--R2(dhcp)

    What wrong with this config?
    R1:
    int fa0/0
    ip add 192.168.1.1 255.255.255.0
    ip helper-address 192.168.2.2
    int fa0/1
    ip add 192.168.2.1 255.255.255.0

    R2:
    ip dhcp pool LAN
    network 192.168.1.0
    default-router 192.168.1.1
    int fa0/0
    ip add 192.168.2.2 255.255.255.0



    Did I miss some basics here, so that's the reason this couldn't possibly work or what? Thank you!

    I think your ip address has to be the 192.168.1.1 to hand out the addresses, you also need to exclude the 192.168.1.1 w/
    ip dhcp excluded 192.168.1.1
  • Options
    newman555newman555 Member Posts: 26 ■□□□□□□□□□
    I excluded these addresses(just forgot to write this down),but the link between R1 and R2 is on another subnet (192.168.2.0/24) from the one I want to give addresses to clients on my LAN , and that's the whole point and the reason I want to use relay agent...
  • Options
    newman555newman555 Member Posts: 26 ■□□□□□□□□□
  • Options
    billscott92787billscott92787 Member Posts: 933
    First, I have uploaded a sample to show you how to configure what it is you are trying to accomplish. Here is my output from my configurations.



    R1:
    interface FastEthernet0/0 (Connecting to LAN)
    ip address 192.168.1.1 255.255.255.0
    ip helper-address 192.168.2.2
    duplex auto
    speed auto

    interface FastEthernet1/0 (Connecting to R2)
    ip address 192.168.2.1 255.255.255.0
    duplex auto
    speed auto


    R2:
    ip dhcp pool LAN
    network 192.168.1.0 255.255.255.0
    dns-server 192.168.2.2
    default-router 192.168.2.2

    interface FastEthernet0/0
    ip address 192.168.2.2 255.255.255.0
    duplex auto
    speed auto


    ONE EXTREMELY important addition to this, which I don't know if you did, is don't assume because R2 has the network 192.168.1.0 /24 as a DHCP it has a route to it. By default it doesn't, so even with this configuration being proper (the one above) your host will not get an IP address from the DHCP server. The request will get "TO" the server, but not back to the host. I spent an hour yesterday trying to figure out why I set one of mine up wrong, when doing a debug I figured it out. So you can just configure a static route on R2 like I did

    ip route 192.168.1.0 255.255.255.0 192.168.2.1 (next hop to R1 f0/0 interface)


    Also, I forgot to add a switch imagine in between R1 and the host, but you get the drift.
Sign In or Register to comment.