Koozali.org: home of the SME Server

Get SME's external IP address sent to an e-mailaddress

Sibo

Get SME's external IP address sent to an e-mailaddress
« on: August 16, 2006, 10:20:21 AM »
I want the external ip-address sent to me when it changes. I followed the tweaking faq but i receive the LOCAL ipaddress of SME instead of the EXTERNAL ipaddress. My SME 7 is configured as a server/gateway with 2 network interfaces. Does someone know what to change so that it works?

Below is the faq posted on this site.

* How to get SME's IP adress emailed, if it is not static?

Problem: The provider disconnects after 24 hours. You don't have a static IP, you won't or don't use dyndns and you want to recieve the actual IP of your server as soon as it's changed. All you need is an email-account somewhere. Works on all SME since 4.12.
Solution:

Edit

/etc/ppp/ip-up

and enter at before the exit 0
echo $4 | mail -s "New IP Myserver" your_desired@address.org

where "New IP Myserver" is a text at your choice and "your_desired@address.org" is your email adress.

Offline del

  • *
  • 765
  • +0/-0
Get SME's external IP address sent to an e-mailaddress
« Reply #1 on: August 17, 2006, 05:23:22 AM »
Hi Sibo,

Why not just use dyndns.org ?  I have for at least the last 2 years without any problem. If you pay instead of using the free setup you can use your own domain.

Regards,
Del :pint:
If at first you don't succeed, then sky-diving is not for you!
"Life is like a coin. You can spend it anyway you wish, but you can only spend it once." --Author Unknown

Sibo

Get SME's external IP address sent to an e-mailaddress
« Reply #2 on: August 17, 2006, 05:33:48 AM »
Yes i tried to use dyndns but it didn't work. I think it has to do with the policy of the chinese government to block a lot of websites and i think dyndns is one of them.

Offline MSmith

  • *
  • 675
  • +0/-0
Get SME's external IP address sent to an e-mailaddress
« Reply #3 on: August 17, 2006, 06:24:35 AM »
Any email will do ... inspect the email headers and you will be able to identify your server's IP address.
...

Offline gordonr

  • *
  • 646
  • +0/-0
    • http://www.smeserver.com.au/
Re: Get SME's external IP address sent to an e-mailaddress
« Reply #4 on: August 17, 2006, 11:10:25 AM »
Quote from: "Sibo"

Edit

/etc/ppp/ip-up


You don't need to, and shouldn't, edit /etc/ppp/ip-up as your changes will be lost when the initiscripts package is updated. All you need to do is put a simple script in the directory /etc/e-smith/events/ip-change/ which does:

#!/bin/sh
echo $@ | mail -s "New IP MyServer: $@" someone@example.com

This wll automatically be called from /etc/ppp/ip-up.local when the external IP changes.
............