In order to get my iBGP session working I want to configure a static route from the loopback interface on router A (198.18.1.1/30) to the loopback interface on router B (198.18.1.2/30) and vice versa. How do I do this?
There is no reason to have your loopback addresses with /30 masks. We can get around this issue as mentioned above with more specific static routes, but its bad practice to make a loopback with a /30 netmask.
Router A: config t int loopback 0 ip address 198.18.1.1 255.255.255.255 ip route 198.18.1.2 255.255.255.255 ip.of.interface.on.router.B.plugged.into.router.A router bgp 64535 neighbor 198.18.1.2 remote-as 64535 neighbor 198.18.1.2 update-source loopback0 Router B: config t int loopback 0 ip address 198.18.1.2 255.255.255.255 ip route 198.18.1.1 255.255.255.255 ip.of.interface.on.router.A.plugged.into.router.B router bgp 64535 neighbor 198.18.1.1 remote-as 64535 neighbor 198.18.1.1 update-source loopback0
You may find the following link helpful:
You don't need a static route as they are in the same subnet (given that they are directly connected), it should work right off the bat.
EDIT: Actually, I don't think it really matters what IPs you use for the loopbacks, it could be 184.108.40.206 and 220.127.116.11, as long as the two routers are directly connected and the loopback address is included in the routing process, the route gets advertised.
Connected interface have 0 administrative distance. Static route have 1 administrative distance. 198.18.1.1/30 network have 2 address(198.18.1.1,198.18.1.2). You need create route to 198.18.1.2/32.
ip route 198.18.1.2 255.255.255.255 ROUTER_B_ADDRESS
it will probably work because 198.18.1.2/32 have smaller mask.
Or redistribute 198.18.1.2/32 from B in iBGP.
You should make the loopbacks be /32s. Then, you have the question, how can the loopbacks see each other? Generally, the right way to do this is to use a separate routing protocol to inform the routers of each other's loopbacks.
A is 198.18.1.1 and B is 198.18.1.2 (both /32)
Let's say the /30 link between them is 198.18.2.0/230 with .2.1 on A and .2.2 on B
A: ip route 198.18.1.2 255.255.255.255 198.18.2.2 B: ip route 198.18.1.1 255.255.255.255 198.18.2.1
Or you can use OSPF;
A: router ospf 1 network 198.18.1.1 0.0.0.0 area 0 network 198.18.2.0 0.0.0.3 area 0 B: router ospf 1 network 198.18.1.2 0.0.0.0 area 0 network 198.18.2.0 0.0.0.3 area 0