Solved

C2600 - default gw - howto

Posted on 2004-04-28
9
581 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
  • 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

While it is possible to put two routes in place with the secondary having a higher metric, this may not always work. In the event of a failure that does not bring down the physical interface on the router the primary route is not removed. There is a…
In the hope of saving someone else's sanity... About a year ago we bought a Cisco 1921 router with two ADSL/VDSL EHWIC cards to load balance local network traffic over the two broadband lines we have, but we couldn't get the routing to work consi…
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…

773 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