home machine, dial-up Internet, have a separate ip, open a lot of services, want to access anytime outside how to do? When you go out, remember to connect the ip? In case the line is broken, the ip will change after the automatic reconnection, then the solution may be to use the "peanut shell" software. The peanut shell also has a Linux version, which is really an option, but it is equivalent to publishing your ip to the Internet, assuming that you are not very comfortable with your own security (and you don't know if the peanut shell has collected your information). And your purpose is only a small scope (such as you, your family or a few good friends), then this dynamic ip can be spread by personal mail, I simply explored two solutions, one It is based on knemo+kmail, and the second is based on udev+mail+exim4. Here is a brief introduction:
1. knemo + kmail
knemo is the software for monitoring network under kde, supporting event triggering. Kmail is the mail client under kde. It supports dcop script calls. The configuration steps are as follows:
Create a script that automatically obtains the dial-up connection ip and sends it via kmail:
#!/bin/bash < BR>
FROM="none"
TO="[email protected]"
CC="[email protected]"
BCC=""
SUBJECT="Today's PPP address"
sleep 10s
MESSAGE=`/s Bin/ifconfig |
/bin/sed -e '/PtP/!d' -e 's/^[[:space:]]* inet addr://g' -e 's/[[:space:]]*PtP:. *Mask:.*$//g'`
ATTACHMENT="[] []"
dcop kmail MailTransportServiceIface "sendMessage(QString, QString, QString, QString, QString, QString, KURL ::List)" "$FROM" "$TO" "$CC" "$BCC" "$SUBJECT" "$MESSAGE" $ATTACHMENT
Then execute it as the corresponding notification in the knemo configuration The program is fine. The 2. udev + mail + exim4 The first method is very simple, but you need to use kde and always open your desktop (because you need knemo and kmail than you need) The second way is to get the hardware changes of the kernel. In case of a reconnection, the /sys/device file changes when it is changed, and does not depend on X and the desktop system. The configuration of exim4 is not mentioned here, look online. The corresponding script ( /XXXXX/ppp-address.sh ) is modified as follows: udev Rule Add: /etc/udev/rules.d/Add one below The rules file such as z100_ppp_ip_letter.rules reads:
#!/bin/bash
FROM="none"
TO="[email protected]"
CC="[email protected]"
BCC=""
SUBJECT="Today's PPP address"
sleep 10s
MESSAGE=`/sbin/ifconfig |
/bin/sed -e '/PtP/!d' -e 's/^[[:space:]]* inet addr://g' -e 's/[[:space:]]*PtP:. *Mask:.*$//g'`
echo "$MESSAGE" |
/usr/bin/mail -s "$SUBJECT" -c "$CC" -b "$BCC" "$TO"
ACTION=="add", SUBSYSTEM=="net", KERNEL=="ppp[0-9]", RUN+="/XXXXX/ppp-address.sh"
The original use of Tomcat in Linux does not use the newly created user created by the non-ROOT perm
CentOS(Community Enterprise Operating System) is an open source Operating system. It is almost simil
1.LinuxOSVersion:RedHat AS 52. Network Environment Settings: Host (Linux): IP: 192.168.1.1 NetMark:
In the era of virtualization and cloud computing and the container, we migrated all the application
LVM configuration under SUSE server
Linux common command highlights Daquan
Log all IP user operation logs by login IP
Orphan Process Group and Terminal Session Overview
Introduction to the configuration method of VPN server under Linux operating system
Linux installation of the mail command method to solve the problem of not finding the mail command
How to manually release linux memory
Defense under Linux: How to mitigate DDOS attacks
LOL participates in the battle night must have permanent skin activity website share
Can't I be on Obi Island today? Still my computer problem?
How to delete the drive letter created by the virtual drive?
Win10 TH2 official version of each version of the installation key summary
With Commands In Demand, Windows commands no longer have to remember
How to set the timing shutdown function for iQiyi audio and video?
Win7 system upgrade to win8.1update graphic tutorial
How to set Win8.1 to wake up from sleep to enter password