Ubuntu Two Network Setting

概述 Overview

双网卡(内外网配置)

1
2
3
4
5
6
# The primary network interface
auto eth0
iface eth0 inet static
address 10.0.8.219
netmask 255.255.255.0
up route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.0.8.1

内网配置 后面的route需要默认增加让10.*网段数据均走内网网卡

1
2
3
4
5
6
7
8
# The primary network interface
auto eth1
iface eth1 inet static
address 10.10.10.231
netmask 255.255.255.0
gateway 10.10.10.254

up route add default gw 10.10.10.254 eth1

外网配置 后面的route需要默认增加让default数据均走外网网卡