FreeBSD7/8 + CARP + OPENBGPD + SZIVATTYU MEGOLDVA

Fórumok

Udv,
adott egy freebsd masina ami egy bgp router, openbgpd fut rajta minden ok.
Namost kerult melle egy masik gep CARP-ositva, a gond az hogy a BGP router IP cime a CARP kozos ip cime, de a CARP kozos ip cimen nem tudnak egymassal kommunikalni a BGP routerek. active state-nal lehal a tortenet TCP connection refuse miatt. Tuzfal nincs nem ezzel van gebasz.

itt az ifconfig:
################

em0: flags=8943 metric 0 mtu 1500
options=9b
ether 00:30:48:72:c4:9e
inet 192.168.10.101 netmask 0xffffff00 broadcast 192.168.10.255
media: Ethernet autoselect (1000baseT )
status: active
em1: flags=8943 metric 0 mtu 1500
options=9b
ether 00:30:48:72:c4:9f
inet 10.44.44.1 netmask 0xffffff00 broadcast 10.44.44.255
media: Ethernet autoselect (1000baseT )
status: active
lo0: flags=8049 metric 0 mtu 16384
options=3
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
carp0: flags=49 metric 0 mtu 1500
inet 192.168.10.133 netmask 0xffffff00
carp: MASTER vhid 1 advbase 1 advskew 0
carp1: flags=49 metric 0 mtu 1500
inet 10.44.44.133 netmask 0xffffff00
carp: MASTER vhid 2 advbase 1 advskew 0

ezt dobalja az openbgpd a freebsd-s gepen:
##########################################

neighbor 192.168.10.1: state change Active -> Connect, reason: ConnectRetryTimer expired
neighbor 192.168.10.1: state change Connect -> OpenSent, reason: Connection opened
neighbor 192.168.10.1: state change OpenSent -> Active, reason: Connection closed
neighbor 192.168.10.1: state change Active -> Connect, reason: ConnectRetryTimer expired
neighbor 192.168.10.1: state change Connect -> OpenSent, reason: Connection opened
neighbor 192.168.10.1: state change OpenSent -> Active, reason: Connection closed
neighbor 192.168.10.1: state change Active -> Connect, reason: ConnectRetryTimer expired
neighbor 192.168.10.1: state change Connect -> OpenSent, reason: Connection opened
neighbor 192.168.10.1: state change OpenSent -> Active, reason: Connection closed
neighbor 192.168.10.1: state change Active -> Connect, reason: ConnectRetryTimer expired
neighbor 192.168.10.1: state change Connect -> OpenSent, reason: Connection opened
neighbor 192.168.10.1: state change OpenSent -> Active, reason: Connection closed
neighbor 192.168.10.1: state change Active -> Connect, reason: ConnectRetryTimer expired
neighbor 192.168.10.1: state change Connect -> OpenSent, reason: Connection opened
neighbor 192.168.10.1: state change OpenSent -> Active, reason: Connection closed

192.168.10.1 az egy remote bgp router, azon sincs tuzfal.

a remote bgp routeren ugyanilyen gebasz van, connection refused-eket dobal a logba.

tehat az a gond hogy ha nem a CARP ip cimen akarom osszehozni a bgp kapcsolatot akkor siman megy.
Viszont, ha a CARP-os ip cimen szeretnek menni akkor a fenti problema eloall....
Ugy tunik hogy a CARP-ot valamiert nem szereti az openbgpd, ez vmi bug vagy lehetetlent akarok mar megint csinalni :) Nekem tok egyertelmunek tunik hogy hasznalhatnam a CARP ip-t bgp kapcsolatra
......

bocs az ekezetekert, ezen a billzeten nincs....

update:
csak hogy pontositsak, nem a ket carp-os gepet akarom bgp-n osszekotni, hanem van egy fuggetlen router, amihez ez a CARP "cluster" csatlakozna, bgp-n, eppen az amelyik a master.

update2: itt latszik hogy ha a nem CARP ip megyek ki bgp-vel akkor minden fasza, na erre mondjon nekem valaki okosat

#bgpd -d
startup
route decision engine ready
no kernel support for PF_KEY
session engine ready
listening on 127.0.0.1
SE reconfigured
neighbor 192.168.10.1: state change None -> Idle, reason: None
neighbor 192.168.10.1: state change Idle -> Connect, reason: Start
RDE reconfigured
neighbor 192.168.10.1: state change Connect -> OpenSent, reason: Connection opened
neighbor 192.168.10.1: state change OpenSent -> OpenConfirm, reason: OPEN message received
neighbor 192.168.10.1: state change OpenConfirm -> Established, reason: KEEPALIVE message received
Rib Loc-RIB: neighbor 192.168.10.1 AS65009: update 192.168.10.0/24 via 192.168.10.1
nexthop 192.168.10.1 now valid: via 192.168.10.1
Rib Loc-RIB: neighbor 192.168.10.1 AS65009: update x.x.x.x/24 via 192.168.10.1

Hozzászólások

na nem a gep eroforrasaival van problema, hanem az ellenallomas szabalyaival (licenc), igy van beallitva a technika es nagyon nehezen mozdulnak barmerre is......:) en meg nem ferek hozza a drot vegerol a cucchoz.

Ettol fuggetlenul ez egy csunya hiba szerintem a freebsd-nel ill. az openbgp-nel, mas szervizek ugye siman mennek carp ip-rol, pl. http, smtp, dns, ssh, akarmi........k**va bgpd nem hajlando carp ip-n haladni....mindig belefutok vmi keserves duhito baromsagba, ezek annyira szanalmas hibak. Valahogy most nincs kedvem pingvint nyuzni....de az lesz belole attol felek.

na csinaltam kis csomagelemzest, vannak erdekessegek, ugy tunik a bgp demon a helyes ip cimrol probal kifele kapcsolatot inditani, de vannak ott incorrect csomagok.....vmi nem gyere be

a host200-al van a baj

#tcpdump -vv -i em0 dst 192.168.10.1
tcpdump: listening on em0, link-type EN10MB (Ethernet), capture size 96 bytes
21:39:56.445666 ARP, Ethernet (len 6), IPv4 (len 4), Reply host200.xyz.hu is-at 00:00:5e:00:01:01 (oui Unknown), length 28
21:40:11.457751 IP (tos 0xc0, ttl 64, id 1648, offset 0, flags [DF], proto TCP (6), length 40)
host200.xyz.hu.bgp > core-router.xyz.hu.39826: Flags [R.], cksum 0x9634 (incorrect -> 0x0f79), seq 0, ack 3416433237, win 0, length 0
21:40:31.468986 IP (tos 0xc0, ttl 64, id 1672, offset 0, flags [DF], proto TCP (6), length 40)
host200.xyz.hu.bgp > core-router.xyz.hu.39827: Flags [R.], cksum 0x9634 (incorrect -> 0xd565), seq 0, ack 3724462603, win 0, length 0
21:40:36.468133 ARP, Ethernet (len 6), IPv4 (len 4), Reply host200.xyz.hu is-at 00:00:5e:00:01:01 (oui Unknown), length 28
21:40:51.481095 IP (tos 0xc0, ttl 64, id 1695, offset 0, flags [DF], proto TCP (6), length 40)
host200.xyz.hu.bgp > core-router.xyz.hu.39828: Flags [R.], cksum 0x9634 (incorrect -> 0x52f2), seq 0, ack 4040047022, win 0, length 0
21:41:11.491456 IP (tos 0xc0, ttl 64, id 1717, offset 0, flags [DF], proto TCP (6), length 40)
host200.xyz.hu.bgp > core-router.xyz.hu.39829: Flags [R.], cksum 0x9634 (incorrect -> 0xaac8), seq 0, ack 50057130, win 0, length 0
21:41:16.490605 ARP, Ethernet (len 6), IPv4 (len 4), Reply host200.xyz.hu is-at 00:00:5e:00:01:01 (oui Unknown), length 28
21:41:16.720595 ARP, Ethernet (len 6), IPv4 (len 4), Reply core-router-test is-at 00:30:48:72:c4:9e (oui Unknown), length 28
21:41:31.502564 IP (tos 0xc0, ttl 64, id 1740, offset 0, flags [DF], proto TCP (6), length 40)
host200.xyz.hu.bgp > core-router.xyz.hu.39830: Flags [R.], cksum 0x9634 (incorrect -> 0x5bbf), seq 0, ack 358550607, win 0, length 0
neighbor 192.168.10.1: state change Active -> Connect, reason: ConnectRetryTimer expired
neighbor 192.168.10.1: state change Connect -> OpenSent, reason: Connection opened
neighbor 192.168.10.1: state change OpenSent -> Active, reason: Connection closed
21:41:42.315807 IP (tos 0xc0, ttl 1, id 1752, offset 0, flags [DF], proto TCP (6), length 60)
core-router-test.16049 > core-router.xyz.hu.bgp: Flags [S], cksum 0x95e5 (incorrect -> 0x9e32), seq 2310505025, win 65535, options [mss 1460,nop,wscale 3,sackOK,TS val 1296554 ecr 0], length 0
21:41:42.316298 IP (tos 0xc0, ttl 1, id 1754, offset 0, flags [DF], proto TCP (6), length 52)
core-router-test.16049 > core-router.xyz.hu.bgp: Flags [.], cksum 0x95dd (incorrect -> 0x0216), seq 2310505026, ack 530533118, win 8326, options [nop,nop,TS val 1296554 ecr 55065705], length 0
21:41:42.316368 IP (tos 0xc0, ttl 1, id 1755, offset 0, flags [DF], proto TCP (6), length 97)
core-router-test.16049 > core-router.xyz.hu.bgp: Flags [P.], seq 0:45, ack 1, win 8326, options [nop,nop,TS val 1296554 ecr 55065705], length 45: BGP, length: 45
[|BGP Open]
21:41:51.513176 IP (tos 0xc0, ttl 64, id 1771, offset 0, flags [DF], proto TCP (6), length 40)
host200.xyz.hu.bgp > core-router.xyz.hu.39831: Flags [R.], cksum 0x9634 (incorrect -> 0x8c1c), seq 0, ack 677300465, win 0, length 0
21:41:56.513074 ARP, Ethernet (len 6), IPv4 (len 4), Reply host200.xyz.hu is-at 00:00:5e:00:01:01 (oui Unknown), length 28

ahha latom mar mivan, a fene egye meg, ugye ket ip-je van a carp-os gepnek ugyanabban a subnetben az ellenallomas a 200-as ip-re akar kapcsolodni, viszont a host200 meg a 101-es iprol akar visszajonni neki....na ez gyonyoru, orba szajba oda-vissza ack-znak a nemletezo kapcsolatra.
na akkor ra kell venni valahogy a bgpd-t hogy a carp ip-rol inditson kacspolatot, es ne az alapip-ro....fasza, na lesz ebbol vmi...

na ha a hulyeseg fajna, uvoltenek :)

itt a megoldas, bgpd.conf-ba ez kell, abban az esetben ha carp-on akarjuk futtatni:

local-adress x.x.x.x

az x.x.x.x az a CARP interface cime, ennyi mukodik......szerencsetlen bgpd enelkul nem tudja merre van arcal elore :))

na itt egy bgpd.conf ha valaki elakadna ugyanezzel a helyzettel :))

#################################
listen on 127.0.0.1
AS 65500
log updates
network 10.44.44.0/24 # ezt tenyesztjuk kifele felteve ha ez ellenfel elfogadja :)

router-id 192.168.10.200 # nem art ha ez is a carp iface ip-je, de nem kritikus

CORE="192.168.10.1"
neighbor $CORE {
remote-as 65009
softreconfig in yes
set nexthop self
announce capabilities yes
local-address 192.168.10.200 # ezen az ip-n melozzon a bgpd ( carp iface ip cime )
depend on carp0 #ez azer kell mert ha a carp iface downba van akkor nem akar csatlakozni a peerhez
#ha meg up-ba lesz ( master ) akkor szepen kapcsolodik
}
##################################

na ez egy nulla buta config, csak a pelda kedveert, nincsenek benne ACL-ek, stb !!!!!

egyszer ha lesz egy kis idom, osszeutok egy how-to-t full redundans BGP router epitesrol freebsd-vel meg obgp-vel, masnak mar ne kelljen ezzel szivattyuzni.