Fedora Networking :: Send Out Ip Address At Startup?
Aug 8, 2011
I need to send out ip address every time a machine is booted. So I have a script getting ip address through ifconfig command, parse the result (I do this with python since I'm not familiar with shell) and send out an email. I tried run it after login, and it worked. But it doesn't work if I don't login, but just call it from rc.local.
View 2 Replies
ADVERTISEMENT
Dec 2, 2009
I have several computers at work running Fedora 12. From time to time I need to remotely connect to them, usually via ssh. Each computer is assigned an IP number automatically upon startup, however due to circumstances beyond my control they are not recognized by host name by the domain server. Therefore I require the IP addresses in order to connect rather than the host names. I have no way at present to rectify this situation.
When there is a reboot, I am not always guaranteed that the IP address will be the same as before, although in practice this is usually the case. If the IP address is changed and I am logging on remotely, I am unable to connect! I can't know the number until I am again physically sitting at the computer.
As a solution, I would like each computer to e-mail me its IP address each time it boots. My first attempt was to run a script at the end of /etc/rc.d/rc.local that runs ifconfig and places the output into a file. This file is then sent to my address using sendmail. The script works fine, but I note that the output from ifconfig at this boot stage does not contain an IP address! Obviously, it is being assigned later on in the startup process. Either that or the command ifconfig does not work the same at this stage as it does once I am logged in. I require somebody with more expertise than I to comment on that.
Finally then, my question is, at what point in the startup process is an IP address assigned and the output from ifconfig would contain this address? Is there a more appropriate place rather than rc.local in which I should run my script? Is there a more appropriate command rather than ifconfig that ought to be used instead?
---------- Post added at 05:41 PM CST ---------- Previous post was at 05:30 PM CST ----------
Let me show you my attempted solution in more detail in case you're interested. The script is called .SendIP.bash and is located in my home directory. Here's what it looks like (with some censoring to protect me from public ridicule):
#!/bin/sh
# This script will send ifconfig information to my e-mail account.
# This allows me to have the latest IP address assigned to this computer.
cd /home/MyUserName
hostname > .IPmessage
date >> .IPmessage
ifconfig eth0 >> .IPmessage
sendmail -f$HOSTNAME MyAddress@MyCompany.com < .IPmessage
As I stated above, the output from ifconfig does not contain the IP address when my script is called from rc.local.
View 10 Replies
View Related
Feb 23, 2009
I am currently trying to get a B.A.T.M.A.N mesh network up and running. the thing uses UDP port 4305 for broadcasting to nearby nodes and it seems this port is closed or used by something else.
now i have tried to open this port with commands like
Code:
iptables -A INPUT -p udp --dport 4305 -j ACCEPT
iptables -A OUTPUT -p udp --dport 4305 -j ACCEPT
it still gives me the same error saying the socket cannot connect.any way for me to scan that udp port, see what is blocking it and open the thing up ?
View 4 Replies
View Related
Oct 16, 2009
I'm behind a modem router with firewall and SElinux enabled by default - but checking my mail this morning I noticed several ' delivery failures ' ( allegedly ) from hotmail referring to mail I hadn't sent. When I checked the spam folder for the on-line side of my mail account there were more failure notices. Two points that may be relevant, one is the recent Hotmail exploit, the other is that this only occurred with the address I use for railway matters, and some people cc to everybody, so it's odds on that address is on a good few computers. On one occassion when I checked my spam folder on-line I found spam which claimed to be from myself, so I know the ' send ' address can be spoofed, is this the explanation, or is it a new kind of attack linked to the Hotmail exploit?
View 13 Replies
View Related
Mar 3, 2010
This one has been bugging me for some time now. The network interface (as defined in Debian's /etc/network/interfaces file) fails to obtain an IP address from myuter. However dhclient br0 does.I'm using br0 since I run a XP virtual machine.network/interface changes are from a Debian howto on setting up the tap interface.As near as I can tell, the /etc/init.d/networking script basically calls /sbin/ifup -a. ifup is a binary.My /etc/network/interfaces file is:
auto lo
iface lo inet loopback
address 127.0.0.1
[code]...
View 5 Replies
View Related
Sep 26, 2010
I want to send Received UDP Packets to neighbor MAC Address. Anyone can guide me to how to do it?
I can received UDP packets and then forward to unicast address as follow: How can i modify this codes (Maybe Last Line) to send the received packets to destination MAC Address instead of destination IPv6 Address?
Code:
int main(int argc, char ** argv)
{
int s,s1;
struct sockaddr_in6 a,a1;
[Code]....
View 8 Replies
View Related
May 5, 2010
I've come across a strange issue where any email address that I email with mail returns an error "Bad Address"
Fairly new Centos 5.4 Install, sendmail is the MTA.
Linux 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
DNS is working fine so there isn't a problem.
[root@hn1 /]# host -t mx iol.co.za
iol.co.za mail is handled by 10 mg1.iol.co.za.
iol.co.za mail is handled by 10 mg2.iol.co.za.
iol.co.za mail is handled by 30 vulpix.iol.co.za.
Yet when I try to use mail it fails:
[root@hn1 /]# which mail
/bin/mail
[root@hn1 /]# ls -lrth /bin/mail
-rwxr-xr-x 1 root mail 83K Jan 7 2007 /bin/mail
[root@hn1 /]# mail -s "test" bob@mydomain.co.za
Bad address
Nothing in the maillog.
View 1 Replies
View Related
Jan 3, 2011
I am trying to send a log file mail on startup of debian system but nometter what I do it does not work.
I tried to create an init.d script or adding to rc.local but none works. Odd thing is only the email part is non-functional the rest of the script works as it should so there is no problem. I also give the full path to the command but no results.
cat /var/log/god_of_the_logs.log | mail -s "blah blah" xxx@xxx.com"
I can send emails by running the same command as a user or root but as a startup script it just does not work.
View 2 Replies
View Related
Aug 2, 2011
I need to know how to send message (or execute script ) when the linux machine shutdown or reboot stage.
Actually I want to start a backup linux machine when main server shutdown or Reboot.
simply, how we can run script while init 0 OR init 6 command
View 3 Replies
View Related
Apr 15, 2011
I am running Debian Squeeze with the following basic services running:DNS
DHCP
Samba
Squid
The server is setup with three NICs: eth0 (WAN1), eth1 (WAN2), and eth2 (LAN).The server addresses clients with an IP range of 10.0.30.1 - 10.0.30.254. Some clients will be set with reservations so they fall into the 10.0.40.1 - 254 range.
What I want to do is have any outgoing external traffic coming from the first range (10.0.30.0) to use WAN link 1, and any outgoing external traffic coming from the second range (10.0.40.0) to use WAN link 2.
I have sort of got something working. I have created a bare minimum transparent squid3 setup on port 3128, and set the iptables as follows:
Code:
iptables -t nat -A PREROUTING -i eth2 -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.0.0.1:3128
iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
iptables -t nat -A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
I can get internet access, however obviously it only goes through one WAN link. It also seems slower than it should be. I experimented with tcp_outgoing_address, but seemed to not be my friend.
View 4 Replies
View Related
Mar 4, 2010
i have a small issue, to make our network more secure, i now require outgoing email to require authentication. Now the problem..i have a automated mailer that does not have the option to authenticate. is there a way to allow a certain email address or the local network to send out without authentication? If i cannot do this for a single email user to allow them through with authentication, how would i remove the authentication paramaters in the postfix smtp..
View 2 Replies
View Related
Aug 17, 2011
I'm writing a script that will send an alert email given certain conditions. I have the impression that sendmail is what I need to do that. I just don't know how to use sendmail at all. I assume I have to set it up like a typical mail client so that it has a mail server to log into to send from.
I've looked through the man pages, but I can't find anything in plain English there on how to set it up, or how to use it once it is set up.
View 14 Replies
View Related
Feb 24, 2010
Currently my OS is Ubuntu 9.04 Jaunty Jackalope Desktop OS and my web server is Apache2. I have a public address 60.x.y.z and my pc local address is 10.x.y.z. I have a web app in my Apache2 which currently run in localhost(10.x.y.z).
I would like to enable the web app so that it could be browse from outside. I know there maybe some port forwarding process and some commands involved in order to do that. But I have no idea on the steps to do that.
View 5 Replies
View Related
May 12, 2011
I am working on implementing a protocol on NS2.34 .I really need help to solve this problem . Actually , I don't now whether the problem is generated by the tcl code or the c++ code when I run the simulation, I get this result :
Code:
num_nodes is set 64
INITIALIZE THE LIST xListHead
34
45
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
code....
View 1 Replies
View Related
Jun 9, 2011
I use a server with 3 nics,
eth0 192.168.2.100 (internal Web, Mail)
eth1 192.168.3.100 (Default Gateway nic for clients)
eth2 192.168.3.110 (should be default Gateway for all outgoing traffic not belonging to 192.168.2.100 and 192.168.3.100)
They are all on the same machine
i cannot set eth1 or eth2 as default gateway, as outside requests to eth0 would be handled in a false manner (somehow)
is there an easy iptables-rule to say, that outgoing traffic, not belonging to my networks can be redirected to a specific NIC (eth2)?
View 3 Replies
View Related
Apr 24, 2010
Consider the following program:
Code:
#include <stdio.h>
#include <stdint.h>
[code]...
View 2 Replies
View Related
Dec 16, 2010
Version 10.04 LTS. Installed desktop version and network worked but I needed a static IP address and the install configures for a DHCP configured address. I tried changing to static address using the System->Preferences->Network Connections application but was unable to get the system to come up with the network up.
So I manually modified the /etc/network/interfaces and the /etc/resolv.conf files. I restart the system but when I do an ifconfig, I don't see a configured IP address on eth0 (only the loopback address). If I run /sbin/ifup eth0 everything then works fine and ifconfig shows the correct address bound to eth0.
My files are as follows:
View 2 Replies
View Related
Mar 12, 2011
I'm running Ubuntu 10.10 and I'm having problems trying to assign it a static IP address. No matter what I put in the Preferences->Networking area (identifying the interface as Manual)... it still will query DHCP for an address if I run the dhclient command. I'm using to using ubuntu server where I just set the IP in the interfaces config file.
View 1 Replies
View Related
May 7, 2010
I am running my own Postfix mail server. Some time ago I noticed that most email was rejected because of the server's dynamic IP address. So I got a fixed IP address. However then I noticed that some mails got rejected due to failing the reverse DNS check. So my ISP told me to get a range of IP addresses and they could then create a PTR record for one of those addresses. That is now running but it turns out that the IP address used for the PTR record is a ... dynamic IP address. So Spamhaus PBL rejects my emails again.
View 1 Replies
View Related
Jun 8, 2009
I'm using Fedora 9 and I recently transferred my hard drive to a new laptop. Everything went smoothly except the wireless, which promptly broke. I played around with the network service and the NetworkManager service and chkconfig stuff and system-config-network, until I finally got it to work. Now I have wireless, but every time I shut down, I get some error-like messages:
"ipw2200: Failed to send SYSTEM_CONFIG: Already sending a command." repeating every second for about 3 or 4 seconds before it finally does shut down.
These also appear in dmesg, usually about 20 in a row, thus my concern. My wireless device's interface is eth3. How to get rid of this message while still keeping wireless connectivity.
View 1 Replies
View Related
Aug 23, 2010
I am a bit new to fedora I have the following scenario in testbed of mobile ad hoc network
pc1 pc2 pc3 pc4
192.168.1.1 192.168.1.2 192.168.1.3 192.168.1.4
Now I have the source as pc1 and pc4 is destination and I want to send data/ping pc4 from pc1 via pc2 and pc3 using firewall firestarter,
View 1 Replies
View Related
May 6, 2011
first time user of F14 here. Used PCLinuxOS so far. Installed F14 fine , got samba up, set the hostname of the box to fedora.linux BUT when I connect to my wireless router (Belkin) the hostname shown in the routers DHCP client list is different:
Router shows:
IP Address-----Host Name-----------------MAC Address
192.168.2.4----ralf-FK790AA-ABA-m9---00:22:5F:17:dE:98
In terminal it shows
[dagaz@fedora ~]$ hostname
fedora.linux
[dagaz@fedora ~]$
When I search the forum or google, I end up with hostsfile or samba howtos. Those settings all show the right name : fedora.linux Why does the router show ralf-FK7 etc..? and where can I change it?
View 1 Replies
View Related
Jun 7, 2009
I have a few external IP's assigned to me by my ISP. I have IPcop as my router/firewall. I am wondering how to bind 1 of my external ip's to my internal ip address. So I do not have to port forward, etc. For Example, 77.77.77.77 to 192.168.1.123 and on the server it see's the external IP address.
View 2 Replies
View Related
Feb 17, 2009
Some people may need to change the mac address of their ethernet network cards. This can be easily done with fedora with command line. Just follow the steps below:
1. Log as root on a textual console (ctrl+F2) or through "su -" command in your console
2. Print your network configuration with ifconfig
[root@localhost ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:23:8B:6A:7E:9E
inet addr:10.1.128.244 Bcast:10.1.255.255 Mask:255.255.0.0
inet6 addr: fe80::218:8bff:fedb:7e9e/64 Scope:Link
[code].....
Here, eth0 is the ethernet interface of your system. The mac address is put in red.
3. Change your mac address using the following syntax
ifconfig eth0 hw ether 00:18:8BA:7E:90
The new value (in green) must be hexadecimal
4. if you have a dhcp server that distributes the adresses automatically, then request a new adress for your eth0 interface
[root@localhost ~]# dhclient eth0
5. Now, your interface is up and have a new mac and IP addresses. This feature may be useful if the network administrator ban you according to the mac adress, for example .........
[URL]
View 1 Replies
View Related
Aug 2, 2009
I downloaded Fedora 10 32bit and put it on a Dell Dimension 8200 to save it from the recycle bin. Everything seems to work except I cannot get an IP addr. Roadrunner is my ISP using a cable modem and a Linksys Instant Broadband Series Etherfast Cable/DSL router model BEFSR41. In system-config-network, the nic shows inactive. If I activate it a window opens saying "determining IP information for eth0". After a short time the message adds the word "failed". Using a Windows PC on the same network, I can look at the DHCP connections on the Linksys and I see the MAC addr for the PC running Fedora.
From the OS installation, /etc/sysconfig/networking/devices/ifcfg-eth0 has following:
DEVICE=eth0
HWADDR=00:80:ad:d1:88:c9
ONBOOT=yes
[Code]....
View 6 Replies
View Related
Aug 3, 2009
I have specified Primary DNS address in Network Manager's DNS tab and saved those settings. But when I restart my PC, Primary DNS address will go blank. How can I save this address premanently?
View 6 Replies
View Related
Jul 28, 2010
What I am trying to do is the following: I have many IBM MT-M 6223 towers (Intel Xeon processor) that need to run a certain Fedora 9 configuration. It is working on one box, now it needs to be replicated on all of the others. What is being done is the working box is cloned, and then that image is loaded on all of the others.These boxes have 5 total Ethernet devices. There is one on-board port, and there are two 2-port expansion cards for a total of 5.
There was one initial problem out of the gate that has since been solved (or perhaps not completely). What was happening is that the boxes that received the cloned image had their Ethernet devices misnumbered. Instead of eth0 through eth4, they were numbered eth5 through eth9.This was eventually traced to the following file: /etc/udev/rules.d/70-persistent-net-config. That file contained the original settings from the box that was first cloned. It had eth0 through eth4 at the top with MAC addresses belonging the box that was the source of the cloned image. It looks like this mismatch was detected, and five more entries, numbered eth5 through eth9, got appended to the bottom with MAC addresses belonging to the new box.
Once /etc/udev/rules.d/70-persistent-net-config was deleted, and the machine rebooted, the 5 ethernet devices came up with the correct numbering (0 thru 4). /etc/udev/rules.d/70-persistent-net-config was rebuilt with the correct devname-MAC pairing.
Now for this new problem.... Part of the configuration across all these machines is that only eth3 should have an IP address. It is a static IP address set through the /etc/sysconfig/network-scripts/ifcfg-eth3 file. All of the other devices must NOT have any IP address. They are either not used or used only for raw Ethernet.After clearing out /etc/udev/rules.d/70-persistent-net-config, /etc/sysconfig/network-scripts/ifcfg-eth3 was edited to give the new box its own unique static IP address before rebooting.Sample ifcfg-eth3 file:
Code:
DEVICE=eth3
BOOTPROTO=static
[code]....
View 2 Replies
View Related
Nov 20, 2010
How to set the ip address to particular device(ethernet device)
View 4 Replies
View Related
Mar 26, 2011
I've just reinstalled F14 with KDE rather than Gnome and I'm finding that I'm unable to assign a static IP address to my wired connection.
KDE automatically connects via DHCP, but when I go into KDE's network manager, the eth0 connection isn't listed. In fact, no wired connection is listed. If I manually add one with the correct settings (including a static IP), it switches back to DHCP upon rebooting.
How can I get around this? Should I install the networkmanager-gnome package?
View 5 Replies
View Related
Jun 9, 2011
i have run a ftp server with vsftpd. i set a public ip address on my server . but i want to define a name for this ip address (for example ftp.test.com) how can i do that?
View 5 Replies
View Related