- 已编辑
问题描述:
按照simulate_with_bird.md将bird作为模拟路由器,在物理路由器上添加静态路由,将eip范围的请求路由到bird服务器
- 现象
- 通过porter成功获取到了ip
- 在k8s集群和bird服务器上操作网络是通的(可以ping通外部地址,并且curl通过外部地址上的服务)
- 问题
- 在局域网中其他PC无法通过外部地址访问服务,可以ping通外部地址
配置信息
- bird配置如下
router id 192.168.1.106; # bird所在服务器IP
protocol kernel {
scan time 60;
import none;
export all; # Actually insert routes into the kernel routing table
merge paths on;
}
protocol device {
scan time 60;
}
protocol bgp neighbor1 {
interface "eno4";
local as 65001;
neighbor 192.168.1.118 port 17900 as 65000; # porter-manager所在服务器
source address 192.168.1.106; # bird所在服务器IP
import all;
export all;
enable route refresh off;
add paths on;
}
- bgpconf配置如下
apiVersion: network.kubesphere.io/v1alpha2
kind: BgpConf
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: >
{"apiVersion":"network.kubesphere.io/v1alpha2","kind":"BgpConf","metadata":{"annotations":{},"name":"default"},"spec":{"as":65000,"listenPort":17900,"routerId":"192.168.1.118"}}
name: default
spec:
as: 65000
listenPort: 17900
routerId: 192.168.1.118
- bgppeer配置
apiVersion: network.kubesphere.io/v1alpha2
kind: BgpPeer
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: >
{"apiVersion":"network.kubesphere.io/v1alpha2","kind":"BgpPeer","metadata":{"annotations":{},"name":"bgppeer-bird"},"spec":{"conf":{"neighborAddress":"192.168.1.106","peerAs":65001}}}
name: bgppeer-bird
spec:
conf:
neighborAddress: 192.168.1.106
peerAs: 65001
- eip配置
apiVersion: network.kubesphere.io/v1alpha2
kind: Eip
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: >
{"apiVersion":"network.kubesphere.io/v1alpha2","kind":"Eip","metadata":{"annotations":{},"name":"eip-pool-100"},"spec":{"address":"192.168.100.10-192.168.100.255","disable":false,"interface":"ens192","protocol":"bgp"},"status":{"firstIP":"192.168.100.10","lastIP":"192.168.100.255","occupied":false,"poolSize":246,"ready":true,"usage":1,"v4":true}}
name: eip-pool-100
spec:
address: 192.168.100.10-192.168.100.255
interface: ens192
protocol: bgp