cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5798
Views
0
Helpful
11
Replies

DHCP for PC at g0/1 from g0/0 for cisco 1941

phuayhow01
Level 1
Level 1

Hi all,

     I have this cisco 1941 router with two ethernet ports g0/0 and g0/1. The g0/0 is connected to office LAN with internet access. As my office LAN is DHCP, it will assigned a IP address for g0/0 since this g0/0 is configured as "ip address dhcp". Now my question is that i have a group of 5 pcs, namely PC1, PC2, PC3, PC4 and PC5 that is connected to the switch and one of the ports of this switch is connected to g0/1 of cisco 1941. Is it possible that let say PC2 and PC3 (both DHCP enabled) could access the internet access from g0/0 and at the same time, the office LAN assigned IP address for PC2 and PC3 automatically?

                                                       Office Lan with internet access (DHCP) (Default gateway 10.0.0.1)                                      

                                                                                          |

                                                                                          |

                                                        g0/0 (DHCP enable) (DHCP assigned IP address 10.0.0.138)

                                                                                 Cisco router 1941

                                                                                       g0/1

                                                                                           |

                                                                                           |

                                                                                  HP Switch

                                                                                           |

                                                                          PC1 PC2 PC3 PC4 PC5

                                      

       As i am a newbie, is this operation possible? if possible, could somone guide me how to configure inside the router 1941 to achieve this objective?

Thank and Regards,

Raymond                

2 Accepted Solutions

Accepted Solutions

Hi Raymond,

1) I use one of the PC5 which has the static ip address of 10.10.10.4, 255.255.255.0, default gateway 10.10.10.1, i could get a reply from 8.8.8.8 after i perform a ping function but when i surf the internet using internet explorer, it cannot. Any idea what happened

A) This could be issue with the dns. Please check what is the dns configured on the PC? Try setting the DNS as 4.2.2.2 on the PC and try browsing the internet.

2) When i switch PC5 from static ip address to dhcp mode (select obtain the ip address automatically), it failed to do so. Any idea what needed to configure inside the router to solve this issue?

A) If you expecting the PC to pick ip address from DHCP server enabled on internet access device, that is not going to work as they are not different ip subnet. You could enable the router 1941 to act as a DHCP server and ensure the clients pick ip address from it. A typical configuration would be as below.

conf terminal

ip dhcp excluded-address 10.10.10.1 10.10.10.10

ip dhcp pool DATA

network 10.10.10.0 255.255.255.0

dns-server 4.2.2.2 10.0.0.1

default-router 10.10.10.1

Regards

Najaf

Please rate when applicable or helpful !!!

View solution in original post

kcnajaf
Level 7
Level 7

Hi,

4.2.2.2 is a public DNS server. In Internet everything works on ip address. When you browse Internet you use names like google.com. This name had to be covered to the ip address for which we use DNS servers.

To answer your second question I need to understand if you have access to the Internet device? What device is it? Does it have option to configure multiple DHCP scopes etc...

Regards
Najaf

Sent from Cisco Technical Support iPhone App

View solution in original post

11 Replies 11

kcnajaf
Level 7
Level 7

Hi Raymond,

Yes it will be possible as long a NATing is enabled on the Cisco Router 1941.

A typical configuration would be as below. Please modify ip address as per your requirment.

interface Gig0/0

ip address 10.0.0.1 255.255.255.128

ip nat outside

!

interface Gig0/1

ip address 10.0.0.130 255.255.255.128

ip nat inside

!

ip nat inside source list 1 interface Gig 0/0 overload

!

access-list 1 permit 10.0.0.128 0.0.0.128

!

ip route 0.0.0.0 0.0.0.0 x.x.x.x (Gateway for internet)

Hope that helps.

Regards

Najaf

Please rate when applicable or helpful !!!

Hi najaf,

    Thank for your swift reply. There is slightly changes to my previous setup. My latest setup is as followed:

    

                            Office Lan with internet access (DHCP) (internet default gateway 10.0.0.1)                                      

                                                                                          |

                                                                                          |

                                                        g0/1 (DHCP enable) (DHCP assigned IP address 10.0.0.138)

                                                                                 Cisco router 1941

                                                                     g0/0 (10.10.10.1 255.255.255.0)

                                                                                           |

                                                                                           |

                                                                                  HP Switch

                                                                                           |

                                                                    PC1 PC2 PC3 PC4 PC5 (10.10.10.4)

     When i type command "show interface g0/1" inside the cisco router 1941, i could see that g0/1 has been assigned a ip address of 10.0.0.138.

Below is my full router configuration:

Current configuration : 3386 bytes
!
! Last configuration change at 08:22:14 UTC Wed Mar 13 2013 by cisco
version 15.1
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
!
hostname Pioneer
!
boot-start-marker
boot-end-marker
!
!
logging buffered 51200 warnings
enable secret 4 tnhtc92DXBhelxjYk8LWJrPV36S2i4ntXrpb4RFmfqY
!
no aaa new-model
!
!
no ipv6 cef
ip source-route
ip cef
!
!
!
!
ip domain name yourdomain.com
!
multilink bundle-name authenticated
!
crypto pki token default removal timeout 0
!
crypto pki trustpoint TP-self-signed-625968446
enrollment selfsigned
subject-name cn=IOS-Self-Signed-Certificate-625968446
revocation-check none
rsakeypair TP-self-signed-625968446
!
!
crypto pki certificate chain TP-self-signed-625968446
certificate self-signed 01
  30820229 30820192 A0030201 02020101 300D0609 2A864886 F70D0101 05050030
  30312E30 2C060355 04031325 494F532D 53656C66 2D536967 6E65642D 43657274
  69666963 6174652D 36323539 36383434 36301E17 0D313231 31323830 36313231
  385A170D 32303031 30313030 30303030 5A303031 2E302C06 03550403 1325494F

!
!
username cisco secret 4 tnhtc92DXBhelxjYk8LWJrPV36S2i4ntXrpb4RFmfqY
!
redundancy
!
!
!
!
!
!
interface Embedded-Service-Engine0/0
no ip address
shutdown
!
interface GigabitEthernet0/0
description $ETH-LAN$$ETH-SW-LAUNCH$$INTF-INFO-GE 0/0$
ip address 10.10.10.1 255.255.255.0
ip nat inside
ip virtual-reassembly in
duplex auto
speed auto
!
interface GigabitEthernet0/1
ip address dhcp
ip nat outside
ip virtual-reassembly in
duplex auto
speed auto
!
ip forward-protocol nd
!
ip http server
ip http access-class 23
ip http authentication local
ip http secure-server
ip http timeout-policy idle 60 life 86400 requests 10000
!
ip nat inside source list 1 interface GigabitEthernet0/1 overload
ip route 0.0.0.0 0.0.0.0 10.0.0.2
!
access-list 1 permit any
!

!

!
control-plane
!
line con 0
login local
line aux 0
line 2
no activation-character
no exec
transport preferred none
transport input all
transport output pad telnet rlogin lapb-ta mop udptn v120 ssh
stopbits 1
line vty 0 4
access-class 23 in
privilege level 15
login local
transport input telnet ssh
line vty 5 15
access-class 23 in
privilege level 15
login local
transport input telnet ssh
!
scheduler allocate 20000 1000
end

        I use one of the PC5 which has the static ip address of 10.10.10.4, 255.255.255.0, default gateway 10.10.10.1, i could get a reply from 8.8.8.8 after i perform a ping function but when i surf the internet using internet explorer, it cannot. Any idea what happened?

     When i switch PC5 from static ip address to dhcp mode (select obtain the ip address automatically), it failed to do so. Any idea what needed to configure inside the router to solve this issue?

Thank and Regards,

Raymond

Hi Raymond,

1) I use one of the PC5 which has the static ip address of 10.10.10.4, 255.255.255.0, default gateway 10.10.10.1, i could get a reply from 8.8.8.8 after i perform a ping function but when i surf the internet using internet explorer, it cannot. Any idea what happened

A) This could be issue with the dns. Please check what is the dns configured on the PC? Try setting the DNS as 4.2.2.2 on the PC and try browsing the internet.

2) When i switch PC5 from static ip address to dhcp mode (select obtain the ip address automatically), it failed to do so. Any idea what needed to configure inside the router to solve this issue?

A) If you expecting the PC to pick ip address from DHCP server enabled on internet access device, that is not going to work as they are not different ip subnet. You could enable the router 1941 to act as a DHCP server and ensure the clients pick ip address from it. A typical configuration would be as below.

conf terminal

ip dhcp excluded-address 10.10.10.1 10.10.10.10

ip dhcp pool DATA

network 10.10.10.0 255.255.255.0

dns-server 4.2.2.2 10.0.0.1

default-router 10.10.10.1

Regards

Najaf

Please rate when applicable or helpful !!!

Hi Najar,

     I could surf now after setting the DNS to 4.2.2.2. As i am newbie, could i know what is dns 4.2.2.2?

    For point 2, if i do not want to configure my router 1941 as a dhcp server, is there a way for PC5 to obtain an ip address directly from my office LAN via g0/0? 

Regards,

Raymond

kcnajaf
Level 7
Level 7

Hi,

4.2.2.2 is a public DNS server. In Internet everything works on ip address. When you browse Internet you use names like google.com. This name had to be covered to the ip address for which we use DNS servers.

To answer your second question I need to understand if you have access to the Internet device? What device is it? Does it have option to configure multiple DHCP scopes etc...

Regards
Najaf

Sent from Cisco Technical Support iPhone App

Hi Najaf,

     I cannot access to the internet device as it belongs to my service provider.

  

     But anyway, Thank for your explanation.

Regards,

Raymond

Hi Raymond,

If you dont have access to internet device then you are better of running your own DHCP server:-)

Regards

Najaf

Hi Najar,

     Thank for your advice.

Regards,

Raymond

hksantosh10
Level 1
Level 1

Hi,

My setup is bit same as the above.I am using router in between the servers.

find the below details:

server1 ->(GE0/1) Router (GE0/0)<- Server 2

I want to transfer packets from server1 to server2 and vice versa.

can anyone please share the router ip configurations for GE0/0 n GE0/1.

Waiting for your reply champs.....

Hi,

there is nothing special to do unless you configured ACLs or the IOS stateful firewall on the router and as long as each server has the correct route to communicate with the other one.

Regards

Alain

Don't forget to rate helpful posts.

Don't forget to rate helpful posts.

Hi Cadet,

Thanks much for the reply.

I have configured the ip's as below.

server1 (10.0.0.7)->GE0/1 (10.0.0.1) Router GE0/1 (20.0.0.1) <- server2 (20.0.0.6).

I am able to ping from server1 to router and vice versa but unable to do it from server2.

I have tried with same subnet(GE0/1 & GE0/0/)  but router through an error.


If you need any further information please let me know. i will share it.

It will be helpful if you share commands or any links.I am beginner in router configuration.

PS: I am transfering X25 packets from server1 to server2 through router.

Thanks,

Santosh

Review Cisco Networking for a $25 gift card