ubuntu 14.04 configure 3-wire 3IP

1、3 Line 3 IP server interface IP address (vlan interface)

em1.12 Single Unicom: 120.52.139.9 Mask: 255.255.255.240 Gateway: 120.52.139.1

em1.13 Single Telecom: 123.58.236.26 Mask: 255.255.255.248 Gateway: 123.58.236.25

em1.16 Single mobile: 223.71.150.91 Mask: 255.255.255.248 Gateway: 223.71.150.89

2、 Configure routing table labels

test@ubuntu:~$  cat /etc/iproute2/rt_tables

reserved values

255 local

254 main

253 default

0 unspec

#( (Add the following Unicom, Telecom, Mobile routing tags)

252 cnc

251 ct

250 yd

3、 Configure routing table and routing strategy

sudo ip route add table cnc  via 120.52.139.1 dev em1.12 src  120.52.139.9

sudo ip rule add from  120.52.139.9 table cnc

sudo ip route add table ct  via 123.58.236.25 dev em1.13 src  123.58.236.26

sudo ip rule add from  123.58.236.26 table ct

sudo ip route add table yd  via 223.71.150.89 dev em1.16 src  223.71.150.91

sudo ip rule add from  223.71.150.91 table yd

4、 Write routing table and routing strategy to start automatically

test@ubuntu:~$ sudo cat /etc/rc.local

#! /bin/sh -e

rc.local

This script is executed at the end of each multiuser runlevel.

Make sure that the script will "exit 0" on success or any other

value on error.

In order to enable or disable this script just change the execution

bits.

By default this script does nothing.

sudo ip route add table cnc  via 120.52.139.1 dev em1.12 src  120.52.139.9

sudo ip rule add from  120.52.139.9 table cnc

sudo ip route add table ct  via 123.58.236.25 dev em1.13 src  123.58.236.26

sudo ip rule add from  123.58.236.26 table ct

sudo ip route add table yd  via 223.71.150.89 dev em1.16 src  223.71.150.91

sudo ip rule add from  223.71.150.91 table yd

Recommended Posts

ubuntu 14.04 configure 3-wire 3IP
ubuntu modify and configure ip address
Ubuntu configure Tomcat
Ubuntu configure Apache
ubuntu 17.10 set solid IP
Ubuntu configure network commands
Ubuntu18.04, Centos7 static IP
Centos7 configure IP address
Ubuntu18.10 configure Java environment
Ubuntu 18.10 configure Nvidia driver
ubuntu16.04 set static ip
Ubuntu configure SecureCRT login
How to configure a fixed IP based on Ubuntu 18.04
Complete steps to configure IP address in Ubuntu 18.04 LTS
Ubuntu Apache configure https certificate
ubuntu 18.04 set static ip method
Configure static IP under CentOS 7
ubuntu install and configure GitLab
Centos configure multiple virtual IP
Centos configure multiple virtual IP
Ubuntu 18.04 uses elastic network card to configure multiple external network IP
Install and configure MySQL on Ubuntu
Install and configure Docker in Ubuntu
Configure ring after installation on Ubuntu 16.04
Configure Java development environment in Ubuntu20.04 LTS
How to configure Redis cluster on Ubuntu 14.04
Configure Nginx Git server on Ubuntu system
How to set static IP in ubuntu14.04
Configure android debugging tool adb under ubuntu16.04
How to configure Redis replication on Ubuntu 16.04
Ubuntu16.04 configure your own network card information
Configure Nginx + PHP 7.0 + MySQL environment under Ubuntu 16.04
Configure node js and npm under Ubuntu 14.04