lite-raft: High-Availability cluster script in posix shell
hello everybody, I'm writing a High-Availability failover cluster program in shell script based using the raft algorithm at the core. It's still not complete but I started to work toward portability rewriting code that rely on linux only program (like flock binary not present in the default OpenBSD installation). For now I will try to keep it working on Linux (Centos), OpenBSD and HP-UX (11.31 and maybe older). If someone is interested in taking a look at the code and play with it on OpenBSD I will be very happy to receive some feedback. You can download my program here: https://code.google.com/p/lite-raft/ If you know of any community of #! gurus that can be interested in this kind of project let me know!! regards Luigi
Re: quick pppoa howto. get the ip and bypass the router nat
Hi, i wish to share a simple patch to bypass the problem showed in my previous mail. the patch fix 2 problems: 1- with the original /sbin/dhclient-script you don't get the default gateway if it is on a different subnet then your IP. 2- when you put down the interface with ifconfig rl0 down and then you rerun dhclient rl0 , you don't get the IP configured and with a little of debug i found the the dhclient-script execute: ifconfig rl0 inet 84.223.120.116 netmask 255.255.255.255 broadcast 84.223.120.116 ifconfig: SIOCAIFADDR: File exists the problem is that you have a route that conflict with the command: 84.223.120.116/32 link#3 UC 00 - rl0 the route is added the first time and didn't get deleted on a FAIL event (the env is not set by dhclient, i don't know why). the second time you run dhclient rl0 the old_IP and the new_IP is the same and so the delete_old_routes is not executed. i corrected the problem commenting out the line: route add $new_ip_address 127.0.0.1 /dev/null 21 since when you normally configure a static IP address you don't configure such route (please if you know a reason to leave this route let me know). here the patch to /sbin/dhclient-script: # diff -u /sbin/dhclient-script dhclient-script.patched --- /sbin/dhclient-script Sun Mar 11 02:39:21 2007 +++ dhclient-script.patched Mon May 28 22:48:25 2007 @@ -37,7 +37,7 @@ $medium # XXX Original TIMEOUT code did not do this unless $new_routers was set? - route add $new_ip_address 127.0.0.1 /dev/null 21 + #route add $new_ip_address 127.0.0.1 /dev/null 21 } delete_old_alias() { @@ -76,6 +76,9 @@ for router in $new_routers; do if [ $new_ip_address = $router ]; then route add default -iface $router /dev/null 21 + elif [ $new_subnet_mask = 255.255.255.255 ]; then + route add -host $router -interface -link $interface -expire 1 /tmp/dhcp.log + route add default $router /tmp/dhcp.log else route add default $router /dev/null 21 fi EOF regards Luigi On 5/22/07, Luigi Tarenga [EMAIL PROTECTED] wrote: hi all, i have an Adsl internet connection with the tiscali provider and i just solved my problem of getting the IP address on my openbsd machine. i wish to share my experience here, feel free to correct my english :P [...snip...] you can try without the 2 route add command if it works, i had to use them because the gateway is on a different subnet of my public IP and the dhclient command doesn't configure it automatically (anyone know another solution to this?).
quick pppoa howto. get the ip and bypass the router nat
hi all, i have an Adsl internet connection with the tiscali provider and i just solved my problem of getting the IP address on my openbsd machine. i wish to share my experience here, feel free to correct my english :P tiscali's adsl support only pppoa protocol (rfc 2364) and this is a problem if you want to connect with pppoe with a modem/router with ethernet port and you don't want to be natted behind the router. i tried the so called Bridge Mode Only without success while i succesfully used it on another adsl line with pppoe protocol configured by the ISP. The trick come out with the last router's firmware update. The new firmware let me flag an Half Bridge mode. I own a Linksys am200 (annex A) router, you should check if your model support half bridge if you want to try this configuration. Once in Half Bridge the router connect with pppoa to the ISP router, log on with pap/chap and give you the public IP with dbcp protocol, after this it start to work as half bridge: copy the IP packets from the ethernet to the pppoa channel and vice versa. to configure the openbsd box is very simple, just put in /etc/hostname.nfe0 (change with your lan card name): dhcp up !route add -host 213.205.24.16 -interface -link nfe0 -expire 1 !route add default 213.205.24.16 change 213.205.24.16 with the gateway's IP of your ISP (i check this on the router's web administration page, it never change for me), also change nfe0 with your lan card. you can try without the 2 route add command if it works, i had to use them because the gateway is on a different subnet of my public IP and the dhclient command doesn't configure it automatically (anyone know another solution to this?). regards Luigi