I'm having troubles in BIRD configuration, Let me share some background.
There are 2 hosts, host A is 192.168.0.188, and host B is 192.168.0.224. And created the new IP address on the loopback interface:
- host A(192.168.0.188)
- host B(192.168.0.224)
I want to build routes between these 2 hosts. Let the host A be able to connect loopback IP address(3.3.3.1) on host B. After startup the bird on both hosts. The problem happened on the gateway when show the route information on host B:
$ birdcl show route
BIRD 2.0.7 ready.
Table master4:
0.0.0.0/0 via 192.168.0.1 on eth0 unicast [kernel1 21:03:59.593] (10)
2.2.2.1/32 via 192.168.0.1 on eth0 unicast [Uplink0 22:51:04.482 from 192.168.0.188] * (100/?) [i]
I was hoping the routes should have "via 192.168.0.188" instead of "via 192.168.0.1";
Below is the host setup and bird configuration:
# host A
ifconfig lo:0 2.2.2.1 netmask 255.255.255.255 up
ip addr add 2.2.2.1/32 dev lo
# Host B
ifconfig lo:0 3.3.3.1 netmask 255.255.255.255 up
Host A Bird configuration:
log "/var/log/bird.log" all;
router id 192.168.0.188;
protocol device {
debug { states };
scan time 2;
}
protocol kernel {
learn;
scan time 2;
ipv4 {
import all;
export all;
};
}
protocol direct {
debug { states };
interface "lo";
}
protocol bgp {
debug { states };
local 192.168.0.188 as 64514;
neighbor 192.168.0.224 as 64514;
ipv4 {
export filter {
if ( net = 2.2.2.1/32 ) then { accept; }
reject;
};
import all;
add paths on;
};
}
Host A Bird configuration:
log "/var/log/bird.log" all;
router id 192.168.0.224;
protocol device {
debug { states };
scan time 2;
}
protocol kernel {
learn;
scan time 2;
ipv4 {
import all;
export all;
};
}
protocol direct {
debug { states };
interface "lo";
}
protocol bgp {
debug { states };
local 192.168.0.224 as 64514;
neighbor 192.168.0.188 as 64514;
ipv4 {
export filter {
if ( net = 3.3.3.1/32 ) then { accept; }
reject;
};
import all;
add paths on;
};
}
Could you let me know what configuration is need to correct?