前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >ubuntu 16.04 配置双网卡双IP

ubuntu 16.04 配置双网卡双IP

原创
作者头像
夏日萤火
修改2019-07-25 17:17:42
6.1K0
修改2019-07-25 17:17:42
举报
文章被收录于专栏:故障排查

1、在腾讯云控制台进行弹性网卡的绑定:

2、登录到服务器上进行网卡配置:vim /etc/network/interfaces.d/50-cloud-init.cfg

auto eth0:0 iface eth0:0 inet static address 10.0.64.13 netmask 255.255.255.0 gateway 10.0.64.1

auto eth0:1 iface eth0:1 inet static address 10.0.64.16 netmask 255.255.255.0 gateway 10.0.64.1

auto eth1:0 iface eth1:0 inet static address 10.0.64.8 netmask 255.255.255.0 gateway 10.0.64.1

auto eth1:1 iface eth1:1 inet static address 10.0.64.2 netmask 255.255.255.0 gateway 10.0.64.1

3、创建路由表:vim  /etc/iproute2/rt_tables,在后面追加:

10 t1

20 t2

30 t3

40 t4

4、给4张路由表添加默认路由:

ip rule add from 10.0.64.13/32 table 10

ip rule add from 10.0.64.16/32 table 20

ip rule add from 10.0.64.8/32 table 30

ip rule add from 10.0.64.2/32 table 40

5、为防止重启后失效,将路由和策略都加入到rc.local文件,vim /etc/rc.local

6、测试

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
弹性网卡
弹性网卡(Elastic Network Interface,ENI)是绑定私有网络内云服务器 的一种弹性网络接口,可在多个云服务器间自由迁移。您可以在云服务器上绑定多个弹性网卡,实现高可用网络方案;也可以在弹性网卡上绑定多个内网 IP,实现单主机多 IP 部署。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档