Really dumb ifconfig question....
How do I use this tool to bind to an IP address on eth1?
My end goal is to write a bash script that:
1. pings another server regularly
2. if it's down, bind to the server's IP address and effectively take
over a website on this server
Maybe there's a tool that does this already?
Thanks,
Matt
Re: Really dumb ifconfig question....
On Wed, 27 Jun 2007 08:39:10 -0700, matthuwiler wrote:
[color=blue]
> How do I use this tool to bind to an IP address on eth1?
>
> My end goal is to write a bash script that:
>
> 1. pings another server regularly
> 2. if it's down, bind to the server's IP address and effectively take
> over a website on this server
>
> Maybe there's a tool that does this already?
>
> Thanks,
>
> Matt[/color]
you want the heartbeat stuff from:
[url]http://www.linux-ha.org/GettingStarted[/url]
--
D.A.M. - Mothers Against Dyslexia
see [url]http://www.jacksnodgrass.com[/url] for my contact info.
jack - Grapevine/Richardson
Re: Really dumb ifconfig question....
[email]matthuwiler@gmail.com[/email] pisze:[color=blue]
> How do I use this tool to bind to an IP address on eth1?
>[/color]
You can use manual for ifconfig :)
example:
ifconfig eth1 xxx.xxx.xxx.xxx broadcast yyy.yyy.yyy.yyy network
zzz.zzz.zzz.zzz
Where:
xxx.xxx.xxx.xxx - is IP address
yyy.yyy.yyy.yyy - is broadcast address of your network
zzz.zzz.zzz.zzz - is network address
[color=blue]
> My end goal is to write a bash script that:
>
> 1. pings another server regularly[/color]
You can use ping with -c xxx option (xxx - is number of packets)
or use: nmap -nsP x.x.x.x | grep Host (x.x.x.x - server ip address)
Try hping if you want more advanced tool :)
[color=blue]
> 2. if it's down, bind to the server's IP address and effectively take
> over a website on this server
>
> Maybe there's a tool that does this already?
>[/color]
I don't know :)
[color=blue]
> Thanks,
>
> Matt
>[/color]
Re: Really dumb ifconfig question....
On Jun 27, 1:25 pm, Komuch <kom...@--USUN-TO--komuch.pl> wrote:[color=blue]
> matthuwi...@gmail.com pisze:
>[color=green]
> > How do I use this tool to bind to an IP address on eth1?[/color]
>
> You can use manual for ifconfig :)
> example:
> ifconfig eth1 xxx.xxx.xxx.xxx broadcast yyy.yyy.yyy.yyy network
> zzz.zzz.zzz.zzz
>
> Where:
>
> xxx.xxx.xxx.xxx - is IP address
> yyy.yyy.yyy.yyy - is broadcast address of your network
> zzz.zzz.zzz.zzz - is network address
>[color=green]
> > My end goal is to write a bash script that:[/color]
>[color=green]
> > 1. pings another server regularly[/color]
>
> You can use ping with -c xxx option (xxx - is number of packets)
> or use: nmap -nsP x.x.x.x | grep Host (x.x.x.x - server ip address)
>
> Try hping if you want more advanced tool :)
>[color=green]
> > 2. if it's down, bind to the server's IP address and effectively take
> > over a website on this server[/color]
>[color=green]
> > Maybe there's a tool that does this already?[/color]
>
> I don't know :)
>[color=green]
> > Thanks,[/color]
>[color=green]
> > Matt[/color][/color]
Thank you for this! Question though... What is the "network" option?
I actually don't have another physical nic, so the interface would be
eth0:1 (I think?)--type on my part. Here is the ifconfig outpt for
eth0 (ips have been changed slightly)
Link encap:Ethernet HWaddr 00:C0:9F:14:82:3F
inet addr:216.93.159.21 Bcast:216.93.159.127 Mask:
255.255.255.224
inet6 addr: fe80::2c0:9fff:fe14:823f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:111181552 errors:0 dropped:0 overruns:0 frame:0
TX packets:124104208 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:3938277490 (3.6 GiB) TX bytes:4189971174 (3.9 GiB)
Base address:0xbc80 Memory:fc3e0000-fc400000
Is the network the netmask? I tried putting the Mask info into the
network option of ifconfig, but it returned "network: Unknown host"
Thanks again for your help!!
Matt
Re: Really dumb ifconfig question....
On Jun 27, 1:23 pm, Jack Snodgrass <jacks_temp_id_ind...@verizon.net>
wrote:[color=blue]
> On Wed, 27 Jun 2007 08:39:10 -0700, matthuwiler wrote:[color=green]
> > How do I use this tool to bind to an IP address on eth1?[/color]
>[color=green]
> > My end goal is to write a bash script that:[/color]
>[color=green]
> > 1. pings another server regularly
> > 2. if it's down, bind to the server's IP address and effectively take
> > over a website on this server[/color]
>[color=green]
> > Maybe there's a tool that does this already?[/color]
>[color=green]
> > Thanks,[/color]
>[color=green]
> > Matt[/color]
>
> you want the heartbeat stuff from:[url]http://www.linux-ha.org/GettingStarted[/url]
>
> --
> D.A.M. - Mothers Against Dyslexia
>
> seehttp://www.jacksnodgrass.comfor my contact info.
>
> jack - Grapevine/Richardson[/color]
I will check this out tonight. Thanks for the info!
Re: Really dumb ifconfig question....
[email]matthuwiler@gmail.com[/email] wrote:
[color=blue]
>
> Thank you for this! Question though... What is the "network" option?[/color]
Ups... My fault... There is no network option... Sorry !
[color=blue]
> I actually don't have another physical nic, so the interface would be
> eth0:1 (I think?)--type on my part.[/color]
Yes, you can do that.
eth0:1 is alias for eth0
Also you can use iproute2, something like this:
ip addr add dev eth0 192.168.1.1/24 brd 192.168.1.255 scope global
and if you want to see ip addresses:
ip addr ls
[color=blue]
> Here is the ifconfig outpt for
> eth0 (ips have been changed slightly)
>
> Link encap:Ethernet HWaddr 00:C0:9F:14:82:3F
> inet addr:216.93.159.21 Bcast:216.93.159.127 Mask:
> 255.255.255.224
> inet6 addr: fe80::2c0:9fff:fe14:823f/64 Scope:Link
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:111181552 errors:0 dropped:0 overruns:0 frame:0
> TX packets:124104208 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:100
> RX bytes:3938277490 (3.6 GiB) TX bytes:4189971174 (3.9 GiB)
> Base address:0xbc80 Memory:fc3e0000-fc400000
>
> Is the network the netmask? I tried putting the Mask info into the
> network option of ifconfig, but it returned "network: Unknown host"
>[/color]
Yes indeed. Don't use network...
[color=blue]
> Thanks again for your help!!
>[/color]
You're welcome :)
Re: Really dumb ifconfig question....
On Jun 27, 3:05 pm, Komuch <kom...@--USUN-TO--komuch.pl> wrote:[color=blue]
> matthuwi...@gmail.com wrote:
>[color=green]
> > Thank you for this! Question though... What is the "network" option?[/color]
>
> Ups... My fault... There is no network option... Sorry !
>[color=green]
> > I actually don't have another physical nic, so the interface would be
> > eth0:1 (I think?)--type on my part.[/color]
>
> Yes, you can do that.
> eth0:1 is alias for eth0
>
> Also you can use iproute2, something like this:
>
> ip addr add dev eth0 192.168.1.1/24 brd 192.168.1.255 scope global
>
> and if you want to see ip addresses:
> ip addr ls
>
>
>
>
>[color=green]
> > Here is the ifconfig outpt for
> > eth0 (ips have been changed slightly)[/color]
>[color=green]
> > Link encap:Ethernet HWaddr 00:C0:9F:14:82:3F
> > inet addr:216.93.159.21 Bcast:216.93.159.127 Mask:
> > 255.255.255.224
> > inet6 addr: fe80::2c0:9fff:fe14:823f/64 Scope:Link
> > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> > RX packets:111181552 errors:0 dropped:0 overruns:0 frame:0
> > TX packets:124104208 errors:0 dropped:0 overruns:0 carrier:0
> > collisions:0 txqueuelen:100
> > RX bytes:3938277490 (3.6 GiB) TX bytes:4189971174 (3.9 GiB)
> > Base address:0xbc80 Memory:fc3e0000-fc400000[/color]
>[color=green]
> > Is the network the netmask? I tried putting the Mask info into the
> > network option of ifconfig, but it returned "network: Unknown host"[/color]
>
> Yes indeed. Don't use network...
>[color=green]
> > Thanks again for your help!![/color]
>
> You're welcome :)- Hide quoted text -
>
> - Show quoted text -[/color]
Awesome... got it working. Thanks for the help guys.