06-07-2019 04:21 AM
I have two servers in active and passive mode, and a cisco router, how can i create a floating IP
Solved! Go to Solution.
06-07-2019 06:10 AM - last edited on 07-27-2023 10:37 PM by Translator
Hello,
I am thinking maybe it is possible to use an EEM script in conjunction with static DHCP reservations. Basically, you assign a static reservatio for your first NIC. If the router cannot ping that NIC (and the assigned IP address) anymore, the EEM script will remove the DHCP reservation and configure a second one (for the second NIC). If NIC 1 comes back up, the process is being reversed...
This is what the configuration would look like (IP and MAC addresses are arbitrary, obviously):
ip dhcp pool SERVER_NIC_1
host 192.168.1.10 255.255.255.0
client-identifier 000b.39c8.4cb2
!
track 1 ip sla 1 reachability
!
ip sla 1
icmp-echo 192.168.1.10 source-interface GigabitEthernet0/0
!
ip sla schedule 1 start-time now life forever
!
event manager applet SERVER_NIC_1_DOWN
event track 1 state down
action 1.0 cli command "enable"
action 2.0 cli command "clear ip dhcp binding 192.168.1.10"
action 3.0 cli command "conf t"
action 4.0 cli command "no ip dhcp pool SERVER_NIC_1"
action 5.0 cli command "ip dhcp pool SERVER_NIC_2"
action 6.0 cli command "host 192.168.1.10 255.255.255.0"
action 7.0 cli command "client-identifier 000a.35d6.4fc3"
action 8.0 cli command "end"
!
event manager applet SERVER_NIC_1_UP
event track 1 state up
action 1.0 cli command "enable"
action 2.0 cli command "clear ip dhcp binding 192.168.1.10"
action 3.0 cli command "conf t"
action 4.0 cli command "no ip dhcp pool SERVER_NIC_2"
action 5.0 cli command "ip dhcp pool SERVER_NIC_1"
action 6.0 cli command "host 192.168.1.10 255.255.255.0"
action 7.0 cli command "client-identifier 000b.39c8.4cb2"
action 8.0 cli command "end"
06-07-2019 04:51 AM
Hello
Can you elaborate what you mean regards your servers , how are you server connected at present in relation to this router?
06-07-2019 05:47 AM
I have two hp servers that need to have HA built between them, is it possible to use a router to acheive active/standby
06-07-2019 06:10 AM - last edited on 07-27-2023 10:37 PM by Translator
Hello,
I am thinking maybe it is possible to use an EEM script in conjunction with static DHCP reservations. Basically, you assign a static reservatio for your first NIC. If the router cannot ping that NIC (and the assigned IP address) anymore, the EEM script will remove the DHCP reservation and configure a second one (for the second NIC). If NIC 1 comes back up, the process is being reversed...
This is what the configuration would look like (IP and MAC addresses are arbitrary, obviously):
ip dhcp pool SERVER_NIC_1
host 192.168.1.10 255.255.255.0
client-identifier 000b.39c8.4cb2
!
track 1 ip sla 1 reachability
!
ip sla 1
icmp-echo 192.168.1.10 source-interface GigabitEthernet0/0
!
ip sla schedule 1 start-time now life forever
!
event manager applet SERVER_NIC_1_DOWN
event track 1 state down
action 1.0 cli command "enable"
action 2.0 cli command "clear ip dhcp binding 192.168.1.10"
action 3.0 cli command "conf t"
action 4.0 cli command "no ip dhcp pool SERVER_NIC_1"
action 5.0 cli command "ip dhcp pool SERVER_NIC_2"
action 6.0 cli command "host 192.168.1.10 255.255.255.0"
action 7.0 cli command "client-identifier 000a.35d6.4fc3"
action 8.0 cli command "end"
!
event manager applet SERVER_NIC_1_UP
event track 1 state up
action 1.0 cli command "enable"
action 2.0 cli command "clear ip dhcp binding 192.168.1.10"
action 3.0 cli command "conf t"
action 4.0 cli command "no ip dhcp pool SERVER_NIC_2"
action 5.0 cli command "ip dhcp pool SERVER_NIC_1"
action 6.0 cli command "host 192.168.1.10 255.255.255.0"
action 7.0 cli command "client-identifier 000b.39c8.4cb2"
action 8.0 cli command "end"
06-08-2019 11:24 AM
06-09-2019 06:11 AM - last edited on 07-27-2023 10:37 PM by Translator
Hello
HA suggests that the servers are some way linked together however your explanation is very vague as to the running of these server interms of what they provide and how they are physically connected.
However if you just wish to have the one servers link active while another is disabled then possible a simple flex link could perform the job but again it all depends on how the servers are physically connected (directy to the router or via switch.
Rtr
int X/0
description Link to primary server
backup interface int X/1
backup delay 10 30
int X/1
description Link to secondary server
Switch
int X/0
description switchport to primary server
switchport backup interface int X/1 preempt delay xx
int X/1
description switchport to secondary server
06-10-2019 04:51 AM - last edited on 07-27-2023 10:47 PM by Translator
I hope the gateways of both servers are used as floating IP.
If you have switch in between the servers then you can use
router-on-stick
method to keep the gateway in the router for the HA requirement.
Active/Standby servers <---->Switch<---->Router
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide