多网络接口,多ip地址配置路由策略,从那个公网ip进入就从对应的ip出去。

0

我在亚马逊云购买了一台服务器,并配置了两个弹性网络接口和对应的4个ip地址!配置如下 Enter image description here 然后我配置了路由策略,不知道对不对。 network: ethernets: eth0: addresses: - 172.31.18.102/20 - 172.31.19.19/20 dhcp4: no nameservers: addresses: - 8.8.8.8 routes: - to: 0.0.0.0/0 via: 172.31.16.1 table: 100 - to: 172.31.18.102 via: 0.0.0.0 scope: link table: 100 - to: 172.31.19.19 scope: link table: 100 routing-policy: - from: 172.31.18.102 table: 100 priority: 300 routing-policy: - from: 172.31.19.19 table: 100 priority: 300 eth1: addresses: - 172.31.30.237/20 - 172.31.17.231/20 dhcp4: no routes: - to: 0.0.0.0/0 via: 172.31.16.1 table: 101 - to: 172.31.30.237 via: 0.0.0.0 scope: link table: 101 - to: 172.31.17.231 scope: link table: 101 routing-policy: - from: 172.31.30.237 table: 101 routing-policy: - from: 172.31.17.231 table: 101 version: 2 我所有的公网ip都可以ping通,但是我的需求是ssh 52.52.106.253这个ip进入的,curl请求网站就从52.52.106.253这个ip出去,现在的出口ip都是50.18.215.189。 可以帮助实现我的需求吗?

asked a year ago85 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions