Where is /dev/ppp0?

Hi,

I’m using a mobile connection via network manager. I see using ifconfig
that there is a ppp0 interface, however I don’t see the special file
/dev/ppp0. Where can it be?

I run updatedb s root to find out, and this is the result:


minas-tirith:/etc/cron.d # locate ppp0
/dev/ippp0
/home/cer/.gkrellm2/data/net/ppp0
/lib/udev/devices/ippp0
/other/home/cer/.gkrellm2/data/net/ppp0
/root/.gkrellm2/data/net/ppp0
/var/run/netconfig/ppp0
/var/run/netconfig/ppp0/netconfig0
/var/run/ppp0.pid
/var/run/ppp_resolv.conf.ppp0
/var/run/SuSEfirewall2/status/interfaces/ppp0
/var/run/SuSEfirewall2/status/interfaces/ppp0/zone
minas-tirith:/etc/cron.d #


(I want to find out in a cron script if the network is up, by testing
existence of /dev/eth0 and /dev/ppp0)


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))

Yes, I’ve wondered about that too. When I activate my internal broadband modem, I note

Nov  4 09:43:29 linux-akl pppd[4246]: Plugin /usr/lib64/pppd/2.4.5/nm-pppd-plugin.so loaded.
Nov  4 09:43:29 linux-akl pppd[4246]: pppd 2.4.5 started by root, uid 0
Nov  4 09:43:29 linux-akl pppd[4246]: Using interface ppp0
Nov  4 09:43:29 linux-akl pppd[4246]: Connect: ppp0 <--> /dev/ttyUSB0
.
.
.

The interface ppp0 created by pppd, does not appear to be a device node as such, but I see it is used to communicate over the USB serial interface.

I guess you could test the output of

ip link

or similar. When my broadband modem is up, I get

4: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 3
    link/ppp

When it is in the process of connecting

5: ppp0: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 3
    link/ppp 

I look forward to reading what you discover and decide to use… :slight_smile:

PPP device interfaces are created dynamically by pppd, and show up in /proc/net/dev when active

cat /proc/net/dev

so maybe you could test the output from this command when required.

On 2012-11-03 21:56, deano ferrari wrote:
>
> Yes, I’ve wondered about that too. When I activate my internal broadband
> modem, I note

Ok, so that makes two of us.

> Code:
> --------------------
> ip link
> --------------------


> minas-tirith:/etc/cron.d # ip link
> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
>     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
> 2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
>     link/ether 00:26:9e:95:62:d9 brd ff:ff:ff:ff:ff:ff
> 3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
>     link/ether 0c:ee:e6:d7:bb:5f brd ff:ff:ff:ff:ff:ff
> 20: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 3
>     link/ppp
> minas-tirith:/etc/cron.d #

I look forward to reading what you discover and decide to use… :slight_smile:

I’m using:


if  -f /var/run/ppp0.pid -o -c /dev/eth0 ]; then


and i haven’t added a test for wlan0 because I don’t have it active now
and I’m unsure where it will appear.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))

On 2012-11-04 00:26, deano ferrari wrote:
>
> PPP device interfaces are created dynamically by pppd, and show up in
> /proc/net/dev when active
>
> Code:
> --------------------
> cat /proc/net/dev
> --------------------
>
> so maybe you could test the output from this command when required.

It doesn’t say the path of the device itself. As for testing the
contents of the file, testing the existence of /var/run/ppp0.pid is easier.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))

AFAIU, network device interfaces (eth0, wlan0, ppp0, lo etc) don’t have device node files as such, although the underlying hardware obviously may have a device node associated with it, (depending on what it is.) By definition, the network stack can be quite complicated, with lots of layers involved. In the case of my broadband modem for example, PPP is used to handle the communication over my device’s USB serial interface (/dev/ttyUSB0). PPP is not a hardware device driver, so I guess would not expect to see a /dev file associated with it as such.

On 2012-11-04 05:56, deano ferrari wrote:
>
> AFAIU, network device interfaces (eth0, wlan0, ppp0, lo etc) don’t have
> devce node files as such, although the underlying hardware obviously may
> have a device node associated with it, (depending on what it is.) By
> definition, the network stack can be quite complicated, soIn the case of
> my broadband modem for example, PPP is used to handle the commication
> over my device’s USB serial interface (/dev/ttyUSB0). PPP is not a
> hardware device driver, so I guess would not expect to see a /dev file
> associated with it as such.

Oh.

But there has to be… to specify it in commands, no?


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))

On 2012-11-04 14:25, Carlos E. R. wrote:
> On 2012-11-04 05:56, deano ferrari wrote:

> But there has to be… to specify it in commands, no?
>

I have an script named “/etc/ppp/ip-up.local”. In it I have noted the
parameters received as:


BASENAME=${0##*/}
INTERFACE=$1
DEVICE=$2
SPEED=$3
LOCALIP=$4
REMOTEIP=$5
IPPARAM=$6

and when the connection closes I log the parameters:


>         logger -p security.notice -t ip-down.local "closing postfix ($BASENAME, $INTERFACE, $DEVICE, $SPEED, $LOCALIP, $REMOTEIP, $IPPARAM, $BYTES_SENT-$BYTES_RCVD)"

which prints lines like this:


> Sep 20 02:32:44 minas-tirith ip-down.local: closing postfix (ip-down.local, ppp0, /dev/ttyUSB1, 9600, 46.222.158.1, 10.64.64.64, /org/freedesktop/NetworkManager/PPP/0, 468607-5193747)

sometimes it is USB1, sometimes USB2. That’s the device. The interface,
though, is ppp0 always, but I wonder if there is a corresponding file in
the filesystem somewhere.

In any case, for the purposes of my script, the file ‘/var/run/ppp0.pid’
works nicely. I could, I suppose, also test for success of grep 'ppp0' /proc/net/dev.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))

On 2012-11-04 00:48, Carlos E. R. wrote:
> On 2012-11-03 21:56, deano ferrari wrote:

>> I look forward to reading what you discover and decide to use… :slight_smile:
>
> I’m using:
>
>


> if  -f /var/run/ppp0.pid -o -c /dev/eth0 ]; then
>
> 

>
> and i haven’t added a test for wlan0 because I don’t have it active now
> and I’m unsure where it will appear.

I found something else: when I connect an ethernet cable, and I get a
connection, there is no /dev/eth* device!

This network manager has me bewildered.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))

I found something else: when I connect an ethernet cable, and I get a
connection, there is no /dev/eth* device!

This network manager has me bewildered.

As explained previously, network device interfaces do not utilise device files, like other drivers, (although they may well have with older kernel implementations).

Operating Systems - Sibsankar Haldar, Alex A. Aravind, Sibsankar Haldar - Google Books

Why are network interfaces not in /dev like other devices? - Unix and Linux