如何找到PPP接口的默认网关?
我使用 Debian Linux 并使用 wvdial,我能够与蜂窝网络建立 ppp 连接。正在创建 ppp0 接口,并为该接口分配 IP 地址。如何找到 PPP 接口的默认网关?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
PPP 是一种点对点协议。你是一分。另一点是默认路由。
PPP is a point-to-point protocol. You are one point. The other point is the default route.
ppp 连接的默认路由在 /etc/ppp/options.pptpd 或 /etc/ 中有配置
default route of ppp connection has config in /etc/ppp/options.pptpd or /etc/
首先,您可以使用 ip 从接口信息中获取它(假设您的 ppp 接口是 ppp0):
其次,当它是 ppp 时,您始终可以选择“默认设备路由”而不是“默认 gw 路由”。在这种情况下,无论 gw 地址如何,您都可以使用 ip:
HTH 将 ppp0 设备添加为默认设备,
巴林特
First of all, you can grab it from the interface info using ip (assuming your ppp interface is ppp0):
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:
HTH,
Bálint
检查内核 IP 路由表以查找默认网关可能会有所帮助:
It might be helpful to check kernel IP routing table to find default gateway with: