Solved

C2600 - default gw - howto

Posted on 2004-04-28
9
578 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
 
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

New Server 172.16.200.2  was moved from behind Router R2 f0/1 to behind router R1 int f/01 and has now address 172.16.100.2. But we want users still to be able to connected to it by old IP. How to do it ? We can used destination NAT (DNAT).  In DNAT…
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…

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now