[plug] Sending mail from command line

Cameron Patrick cameron at patrick.wattle.id.au
Tue Jul 15 17:38:20 WST 2003


On Tue, Jul 15, 2003 at 05:16:23PM +0800, Daniel Pearson wrote:
| Ah, good point. Yeh, when I invoked it the second time I used /sbin/ifconfig
| and still to no avail. I have one machine on ADSL, and one on dialup - how
| would I go about doing it for the ADSL, and would it matter if it was a
| bridged or pppoe connection?

If it's PPPoE then it works the same as with a dial-up connection, but
if it's a bridged connection or if the DSL modem does PPPoE the ifconfig
output looks different and grepping for P-t-P won't help.  Both of the
following came from the output of ifconfig on my firewall at home - the
top one is more-or-less what a normal dialup connection would look like,
and the bottom one is an ADSL connection.

ppp0      Link encap:Point-to-Point Protocol
          inet addr:130.95.39.9  P-t-P:192.168.0.19 Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:7 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:121 (121.0 b)  TX bytes:116 (116.0 b)

eth1      Link encap:Ethernet  HWaddr 00:40:C7:7E:3D:F7
          inet addr:203.59.107.117  Bcast:203.59.107.255 Mask:255.255.255.0
          inet6 addr: fe80::240:c7ff:fe7e:3df7/10 Scope:Link
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10883754 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7613037 errors:0 dropped:0 overruns:0 carrier:0
          collisions:319 txqueuelen:150
          RX bytes:866547924 (826.4 MiB)  TX bytes:784497696 (748.1 MiB)
          Interrupt:10 Base address:0xce00

As you can see, if you're grepping for "P-t-P" then it will produce no
output in the latter case.

I was about to suggest running ifconfig | grep P-t-P by hand but it
looks like James beat me to it.  One suggestion - if you just want to
get the IP address of a specific interface, the following is more
general:
	/sbin/ifconfig ppp0 | grep "inet addr"
or maybe:
	ip addr show ppp0
where ppp0 is whatever network interface you're talking about.

| Also, how would the firewall limit the output from ifconfig?

Aha, you've got me there.  Thinking more carefully, it doesn't sound
likely unless you've done something incredibly weird (SE Linux?).

Cheers,

Cameron.



More information about the plug mailing list