I am using Debian Linux and using wvdial, I am able to establish ppp connection with the cellular network. ppp0 interface is getting created and IP address is assigned for the interface. How do I find out the default gateway for the PPP interface?

有帮助吗?

解决方案

PPP is a point-to-point protocol. You are one point. The other point is the default route.

其他提示

default route of ppp connection has config in /etc/ppp/options.pptpd or /etc/

It might be helpful to check kernel IP routing table to find default gateway with:

netstat -rn

First of all, you can grab it from the interface info using ip (assuming your ppp interface is ppp0):

/sbin/ip addr show ppp0 | grep peer | awk ' { print $4 } ' | sed 's/\/32//'

Second, when it's ppp, you can always choose "default device routing" over "default gw routing". In this case you could add the ppp0 device as your default device regardless of the gw address, using ip:

/sbin/ip route add default dev ppp0

HTH, Bálint

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top