Use the neighbor remote-as command to create a BGP peering session with a given BGP peer—identified by its IP address—in a given AS. Note that the neighbor remote-as command must be issued on both routers on either side of a BGP session for the BGP session to become established.
Consider the simple network structure shown in Figure 10. Routers LA and SanJose are IBGP peers within AS 873. Router SanJose has an EBGP peer, router Boston, in AS 17.
Figure 10: Configuring Neighbors

The following commands configure router Boston with router SanJose as a peer:
- host1(config)#router bgp 17
- host1(config-router)#neighbor 10.5.5.4 remote-as
873
The following commands configure router SanJose with router LA and router Boston as peers:
- host2(config)#router bgp 873
- host2(config-router)#neighbor 10.2.2.3 remote-as
873
- host2(config-router)#neighbor 10.5.5.1 remote-as
17
The following commands configure router LA with router SanJose as a peer:
- host3(config)#router bgp 873
- host3(config-router)#neighbor 10.2.2.4 remote-as
873
neighbor remote-as