Really dumb ifconfig question.... - Networking

This is a discussion on Really dumb ifconfig question.... - Networking ; 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 ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Really dumb ifconfig question....

  1. 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


  2. Re: Really dumb ifconfig question....

    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

  3. Re: Really dumb ifconfig question....

    matthuwiler@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
    >


  4. Re: Really dumb ifconfig question....

    On Jun 27, 1:25 pm, Komuch 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


  5. Re: Really dumb ifconfig question....

    On Jun 27, 1:23 pm, Jack Snodgrass
    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!


  6. Re: Really dumb ifconfig question....

    matthuwiler@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

  7. Re: Really dumb ifconfig question....

    On Jun 27, 3:05 pm, Komuch 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 to Thread