Networking Forums

Networking Forums > Computer Networking > Linux Networking > Really dumb ifconfig question....

Reply
Thread Tools Display Modes

Really dumb ifconfig question....

 
 
matthuwiler@gmail.com
Guest
Posts: n/a

 
      06-27-2007, 03:39 PM
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

 
Reply With Quote
 
 
 
 
Jack Snodgrass
Guest
Posts: n/a

 
      06-27-2007, 05:23 PM
On Wed, 27 Jun 2007 08:39:10 -0700, matthuwiler wrote:

> 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


you want the heartbeat stuff from:
http://www.linux-ha.org/GettingStarted

--
D.A.M. - Mothers Against Dyslexia

see http://www.jacksnodgrass.com for my contact info.

jack - Grapevine/Richardson
 
Reply With Quote
 
Komuch
Guest
Posts: n/a

 
      06-27-2007, 05:25 PM
(E-Mail Removed) pisze:
> How do I use this tool to bind to an IP address on eth1?
>


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

> My end goal is to write a bash script that:
>
> 1. pings another server regularly


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

> 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?
>


I don't know

> Thanks,
>
> Matt
>

 
Reply With Quote
 
matthuwiler@gmail.com
Guest
Posts: n/a

 
      06-27-2007, 06:38 PM
On Jun 27, 1:25 pm, Komuch <kom...@--USUN-TO--komuch.pl> wrote:
> matthuwi...@gmail.com pisze:
>
> > How do I use this tool to bind to an IP address on eth1?

>
> 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
>
> > My end goal is to write a bash script that:

>
> > 1. pings another server regularly

>
> 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
>
> > 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?

>
> I don't know
>
> > Thanks,

>
> > Matt


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

 
Reply With Quote
 
matthuwiler@gmail.com
Guest
Posts: n/a

 
      06-27-2007, 06:39 PM
On Jun 27, 1:23 pm, Jack Snodgrass <jacks_temp_id_ind...@verizon.net>
wrote:
> On Wed, 27 Jun 2007 08:39:10 -0700, matthuwiler wrote:
> > 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

>
> you want the heartbeat stuff from:http://www.linux-ha.org/GettingStarted
>
> --
> D.A.M. - Mothers Against Dyslexia
>
> seehttp://www.jacksnodgrass.comfor my contact info.
>
> jack - Grapevine/Richardson


I will check this out tonight. Thanks for the info!

 
Reply With Quote
 
Komuch
Guest
Posts: n/a

 
      06-27-2007, 07:05 PM
(E-Mail Removed) wrote:

>
> Thank you for this! Question though... What is the "network" option?


Ups... My fault... There is no network option... Sorry !


> I actually don't have another physical nic, so the interface would be
> eth0:1 (I think?)--type on my part.


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


> 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"
>


Yes indeed. Don't use network...

> Thanks again for your help!!
>


You're welcome
 
Reply With Quote
 
matthuwiler@gmail.com
Guest
Posts: n/a

 
      06-28-2007, 03:36 AM
On Jun 27, 3:05 pm, Komuch <kom...@--USUN-TO--komuch.pl> wrote:
> matthuwi...@gmail.com wrote:
>
> > Thank you for this! Question though... What is the "network" option?

>
> Ups... My fault... There is no network option... Sorry !
>
> > I actually don't have another physical nic, so the interface would be
> > eth0:1 (I think?)--type on my part.

>
> 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
>
>
>
>
>
> > 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"

>
> Yes indeed. Don't use network...
>
> > Thanks again for your help!!

>
> You're welcome - Hide quoted text -
>
> - Show quoted text -


Awesome... got it working. Thanks for the help guys.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ifconfig question Linux Networking 4 10-11-2006 10:33 PM
Possible dumb question Steve O Wireless Internet 2 11-23-2005 10:56 PM
A really dumb VPN question =?Utf-8?B?ZHZ3?= Windows Networking 4 02-04-2005 05:45 PM
A dumb question Jack Fisher Windows Networking 4 11-26-2004 03:06 AM
dumb question Alex Bird Wireless Internet 2 04-08-2004 09:40 AM



1 2 3 4 5 6 7 8 9 10 11