Solved

C2600 - default gw - howto

Posted on 2004-04-28
9
585 Views
Last Modified: 2012-05-04
Hi,

I have a Cisco c2611xm.  I would like to know how do I configure such that once I establish a ppp interface connection to the router, how can I make my computer use the router as the default gateway?

ie, my computer is not connected to the router directly by ethernet.  I run a program on my computer that uses some other interface to connect to the router and establishes a ppp interface.  When this is done, I can do a 'route' command and I'll get this

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.1.0.254      *               255.255.255.255 UH    0      0        0 ppp0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo

As you can see, the gw doesn't automatically appears.  I have to manually add in a command like this

route add default gw 10.1.0.254

After this command is run, I'll get this

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.1.0.254      *               255.255.255.255 UH    0      0        0 ppp0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
default         10.1.0.254      0.0.0.0         UG    0      0        0 ppp0


So, what should I add in the router's configurations to make this happen?  

Thanks
Yam
0
Comment
Question by:YamSeng
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
9 Comments
 
LVL 79

Expert Comment

by:lrmoore
ID: 10948769
If your (linux?) computer listens to RIP, you can enable RIP on the router, else you need to post in the linux networking section to get help on setting up the ppp on the linux box itself. Other than a dynamic routing protocol like RIP or OSPF, there is no way for the router to "tell" the computer to use it as the default gateway. This is normally a function of the PPP Client software on the computer...
0
 
LVL 1

Author Comment

by:YamSeng
ID: 10955232
Hi Irmoore,

Yes, I am using Linux only.  And so, I would want to set the router preferably to do so.

Would RIP or OSPF be something I can configure for this router?

Thanks
0
 
LVL 79

Expert Comment

by:lrmoore
ID: 10956938
The router can, but can your linux box?
Rip would be the easiest

router(config)#router rip
router(config)#network a.b.c.0  <-- your LAN network
router(config)#redistribute static <-- assuming you have a static default route

done
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:YamSeng
ID: 10957149
Sorry I don't understand when you refer to "can your Linux box?"   Is there any requirements for the Linux box?

Btw, my network is running on DHCP.  When my linux box establishes a ppp connection to the router, the router automatically assigns a IP address to it.

regards
0
 
LVL 1

Author Comment

by:YamSeng
ID: 11003775
Actually, should I be looking at PPP setup instead?  Coz I heard someone telling me that I should configure the PPP setup on the router instead to achieve this.

Any advice?

Yam
0
 
LVL 1

Author Comment

by:YamSeng
ID: 11011521
ok, I've tried running a simple pppd command with some standard options and also explicitly using "defaultroute" as option.  But there is no difference.  

When I run "route" command, I could only see that there is a new route to a host which is my router.  But it doesn't list it as a default gw.  I still have to manually run the command (as mentioned in my question) to make it a default

Yam
0
 
LVL 1

Author Comment

by:YamSeng
ID: 11036386
ok, I think I have solved the problem.  I realised that I can achieve the results just by adding in some options for pppd.

For the pppd that I am running, there is still option called "defaultroute".  Therefore, once pppd is successful, a ppp interface will be establised.  When the option "defaultroute" is specified, then it'll try to use this ppp connection as the default gateway.  Sorted!

However, I noticed there is a slight problem.  If there is already a default gw present in any other interface, ie eth0, or eth1.....then when the ppp connection is up, the "defaultroute" option will fail and output an error "Already detected a default route".

Although it seems like I've got an solution now....but it's not perfect.  I'll still gladly award the points if anyone can advise on how I can make it better.  ie, even if there is a default gw present, the "defaultroute" should overwrite and still add this gw to the routing table.

Currently, I need to manually run "route del default gw xxxxxx"  to remove any default gw, before I run my pppd.

Thanks
Yam
0
 
LVL 1

Accepted Solution

by:
YamSeng earned 0 total points
ID: 11037777
Sorted!

I think the best solution is to add a 1 line command to add a default gw in /etc/ppp/ip-up.local script.  This script is executed everytime a ppp interface is established.

Therefore, I do not need the "defaultroute" option which will not work when there is already a default gw on any other interface.

Yam
0

Featured Post

Don't Miss ATEN at InfoComm 2017!

Visit booth #2167 to see the  new ATEN VM3200 32 x 32 Modular Matrix Switch. Other highlights include the VE8950 4K HDMI Over IP Extender, VS1912 12-Port DP Video Wall Media Player  and VK2100 ATEN Control System. Register now with Free Pass Code ATEN288!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We've been using the Cisco/Linksys RV042 for years as: - an internet Gateway - a site-to-site VPN device - a leased line site-to-site subnet-to-subnet interface (And, here I'm assuming that any RV0xx behaves the same way as an RV042.  So that's …
I recently attended Cisco Live! in Las Vegas, a conference that boasted over 28,000 techies in attendance, and a week of hands-on learning hosted by a solid partner with which Concerto goes to market.  Every year, Cisco displays cutting-edge technol…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question