cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3284
Views
0
Helpful
10
Replies

What are the command to set static router in my case ?

Hi All, 

I am very new to the network setup, and I need to make this working for some testing purpose. Here are the details: 

1. I have used GNS3 to create a network, that looks like as follows where it contains Cisco7200 Router, Switch and 2 end devices. 

ciscoRouter.png

2. Here is the "running-config" of the R1 Router, 

"

R1#show running-config
Building configuration...

Current configuration : 1161 bytes
!
upgrade fpd auto
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
logging message-counter syslog
!
no aaa new-model
ip source-route
no ip icmp rate-limit unreachable
ip cef
!
!
!
ip dhcp pool LANPOOL
network 192.168.100.0 255.255.255.0
dns-server 192.168.100.1
default-router 192.168.100.1
domain-name TESTSERVER
lease 2 10 50
!
!
no ip domain lookup
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
archive
log config
hidekeys
!
!
!
!
!
ip tcp synwait-time 5
!
!
!
!
interface FastEthernet0/0
ip address dhcp
duplex half
!
interface FastEthernet1/0
description LINE
ip address 192.168.100.1 255.255.255.0
duplex half
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
!
no cdp log mismatch duplex
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4
login
!
end

"

3. And the IPs on this router are: 

"

Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.122.13 YES DHCP up up
FastEthernet1/0 192.168.100.1 YES manual up up

"

These 2 end device are of ip: 192.168.100.2, and 192.168.100.3 respectively. 

 

4. And I have set the gateway on 2 end device: "FSW-108D-2" or "FSW-108D-4", to point to 192.168.100.1. 

5. I was able to ping 8.8.8.8 from the R1 Router.  But if I ping from the end device, I see it reaches 192.168.100.1, but lost after that.  Does someone know why ? 

6. I have googled and in order to make the ping working from the end device, someone told me to set the static router on this R1,  does anyone know what the command would be for my case ? 

 

Thanks a lot. 

 

Jack 

 

10 Replies 10

marceaubueno
Level 1
Level 1

Hello Jack

 

You need to set up a default route pointing to your R1 router's next-hop (the IP address of the device represented by the cloud on your topology): 

 

ip route 0.0.0.0 0.0.0.0 X.X.X.X --> this is the IP address of your R1 router's next hop

 

I have seen a partial configuration, so are you not using NAT or yes? if not you may put a return route to your LAN as follows:

 

ip route 192.168.100.0 255.255.255.0 192.168.122.13

 

HTH

 

Hi there,

Sorry for my poor network knowledge. I have followed your suggestion running both.

1 The first command does not return anything back: 

" 

 ip route 0.0.0.0 0.0.0.0 X.X.X.X --> this is the IP address of your R1 router's next hop

". 

 

2. The 2nd command give me this: 

"
R1(config)#
R1(config)#ip route 192.168.100.0 255.255.255.0 192.168.122.13
%Invalid next hop address (it's this router)
". 

 

3. And here is my latest route picture: 

"

R1#show ip route
Codes: 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

Gateway of last resort is 192.168.122.1 to network 0.0.0.0

C 192.168.122.0/24 is directly connected, FastEthernet0/0
C 192.168.100.0/24 is directly connected, FastEthernet1/0
S* 0.0.0.0/0 [254/0] via 192.168.122.1

"

 

Thanks for the help !

 

Jack 

 

 

 

Hello Jack

The default route looks good on R1, however the return route should be applied on your device represented by the cloud on your topology diagram, now if your take in consideration @luis_cordova configuration it is not needed the return route because we see that R1 and the device represented by the cloud are directly connected.

 

 

luis_cordova
VIP Alumni
VIP Alumni

Hi chunji08@gmail.com ,

 

If the router is your border router, you have to configure a default route and NAT so that the packets can return:

 

ip route 0.0.0.0 0.0.0.0 f0/0

 

access-list 1 permit 192.168.100.0 0.0.0.255

ip nat inside source list 1 interface f0/0 overload

 

interface f0/0

ip nat outside

 

interface f1/0

ip ant inside

 

Regards

chunji08@gmail.com adding additional information about @luis_cordova mentioned, NAT provides (among other options) a security mechanism on the border of your network, this is crucial with Internet mostly, so using NAT, your IPs (or clients) in your LAN will be translated (or represented) for one IP address only (this is what NAT overload or PAT will do, according to the configuration provided by @luis_cordova). you will be able to check this by using the CLI command: show ip nat translations, once you configure NAT on R1. Of course there are another options for NAT all of them are suitable for a different goals and needs. 

 

What I meant on my previous post will work as well for testing purposes, however this is not recommended in a live network.

 

Marcelo  

 

 

adding to other post

 

you need to exclude gateway IP from dhcp pool also

 

(config)# ip dhcp excluded-address 192.168.100.1

 

ip dhcp pool LANPOOL
network 192.168.100.0 255.255.255.0
dns-server 192.168.100.1 8.8.8.8  <-- also good to have google dns name server (once your nat fixed)

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Hello


@balaji.bandi wrote:

adding to other post

 

you need to exclude gateway IP from dhcp pool also

 

(config)# ip dhcp excluded-address 192.168.100.1

 

ip dhcp pool LANPOOL
network 192.168.100.0 255.255.255.0
dns-server 192.168.100.1 8.8.8.8  <-- also good to have google dns name server (once your nat fixed)


Just like to add to @balaji.bandi  comments  ---You don't really need to exclude the active lan interface ip although although it is recommended it wont negate communication.

Google dns 8.8.8.8 is most preferred by all but I would suggest to point your dns to Cisco own umbrella public dns servers it can provide necessary security advantages if required?
208.67.222.222
208.67.220.220

 

 

 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Deepak Kumar
VIP Alumni
VIP Alumni

Hi,

Make some changes with details:

 

ip dhcp pool LANPOOL
network 192.168.100.0 25.255.255.0
dns-server 192.168.100.1 8.8.8.8
default-router 192.168.100.1
domain-name TESTSERVER
lease 2 10 50

Add 8.8.8.8 also so your end device can resolve the DNS name if primary 192.168.100.1 will fail to resolve.

 

Ip route 0.0.0.0 0.0.0.0 FastEthernet0/0

Add default route so any destination which is not available in the routing protocol then it will forward to the next hop. I know your router will auto get a default route from the DHCP server with AD value 254 but I am not sure how did you setup your DHCP server.

 

interface FastEthernet0/0
ip address dhcp
IP nat outside
duplex half
!
interface FastEthernet1/0
description LINE
ip address 192.168.100.1 255.255.255.0
IP nat inside
duplex half
!
ip access-list standard 1 
permit 192.168.100.0 0.0.0.255
!
ip nat inside source list 1 interface FastEthernet0/0 overload

NATing configuration. In the real world network, The private subnets are non-routable means all Private address is blocked by the ISP and upstream filters. The additional benefits of NAT are little security, Hide address etc.

 

ip name-server 8.8.8.8

Configures the IP address of the name server and Domain lookup is enabled by default. So your router can resolve the DNS query. It is required because you had added primary DNS server on your DHCP server as Router inside Interface IP.

 

Regards,

Deepak Kumar

 

 

 

Regards,
Deepak Kumar,
Don't forget to vote and accept the solution if this comment will help you!

Hello


@Deepak Kumar wrote:

 

Ip route 0.0.0.0 0.0.0.0 FastEthernet0/0

Add default route so any destination which is not available in the routing protocol then it will forward to the next hop. I know your router will auto get a default route from the DHCP server with AD value 254 but I am not sure how did you setup your DHCP server

I would suggest refine from using a interface has a specified next hop as a default route, this tells the route to assume anything off it own network is directly connected as such will unnecessary arp for EVERY destination off that interface, suggest to use ip next hop address instead.

example:
ip route 0.0.0.0 0.0.0.0 fa0/0 x.x.x.x
or
ip route 0.0.0.0 0.0.0.0 fa0/0 dhcp 1 <----makes the default route obtained from dhcp to have an admin distace of 1 and not default 254

 



Configures the IP address of the name server and Domain lookup is enabled by default. So your router can resolve the DNS query. It is required because you had added primary DNS server on your DHCP server as Router inside Interface IP.


No sure what you would want a router to perform dns quires this will only incur extra resources on the router?  The clients will using its designated dns obtained from the above dhcp so it and wont negate internet access so i guess it isn't required in this scenario?

 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Hi @paul driver 

Thanks for your comment. 

 

I picked his DHCP configuration and DNS server added on behalf of this configuration:

 

ip dhcp pool LANPOOL
network 192.168.100.0 255.255.255.0
dns-server 192.168.100.1
default-router 192.168.100.1
domain-name TESTSERVER
lease 2 10 50

Regards,
Deepak Kumar,
Don't forget to vote and accept the solution if this comment will help you!
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card