小编fei*_*pet的帖子

Ubuntu Linux 路由器:在 2 个接口上设置出站 NAT

我正在使用 Ubuntu 12.04 设置路由器。我需要我的路由器在我们的互联网调制解调器和我客户的网络之间进行路由,为此我们获得了一个 IP 地址。

盒子有3个接口:

  1. eth0 - 客户端网络的端口。使用静态 IP 配置。
  2. eth1 - 我们的局域网。配置为静态 IP 192.168.1.1 并提供 DHCP/DNS。
  3. eth2 - 上行至 3G 路由器调制解调器。配置为 DHCP 客户端。

我的 /etc/network/interfaces 看起来像:

# The primary network interface
auto eth2
iface eth2 inet dhcp

# LAN point to our client's network
auto eth0
iface eth0 inet static
address 10.198.250.171
#gateway 10.198.0.4
netmask 255.255.0.0
network 10.198.0.0
broadcast 10.198.255.255
hwaddress ether 00:1E:EC:72:ED:92

# eth1 acts as our LAN's router IP
auto eth1
iface eth1 inet static …
Run Code Online (Sandbox Code Playgroud)

linux networking

7
推荐指数
1
解决办法
2833
查看次数

标签 统计

linux ×1

networking ×1