YamSeng
asked on
C2600 - default gw - howto
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
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
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...
ASKER
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
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
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)#redistribut e static <-- assuming you have a static default route
done
Rip would be the easiest
router(config)#router rip
router(config)#network a.b.c.0 <-- your LAN network
router(config)#redistribut
done
ASKER
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
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
ASKER
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
Any advice?
Yam
ASKER
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
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
ASKER
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.