我使用 Ubuntu 14.04 32 位
我有以下问题,我必须共享互联网: 1 Internet Server (eth1) 1 Forward Internet with other network cards (this is the machine that need to configure - eth2) Pcs Customers.
Internet 带有连接服务器的网线,另一块网卡连接到为微型客户端分配的交换机。
问题是:我如何获得一张上网卡并分配另一张?
先谢谢了。
请查看我的系统日志
May 7 10:40:37 asterisk dhcpd: options subnet-mask
May 7 10:40:37 asterisk dhcpd: ^
May 7 10:40:37 asterisk dhcpd: /etc/dhcp/dhcpd.conf line 6: semicolon expected.
May 7 10:40:37 asterisk dhcpd: options broadcast-address
May 7 10:40:37 asterisk dhcpd: ^
May 7 10:40:37 asterisk dhcpd: /etc/dhcp/dhcpd.conf line 7: semicolon expected.
May 7 10:40:37 asterisk dhcpd: options routers
May 7 10:40:37 asterisk dhcpd: ^
May 7 10:40:37 asterisk dhcpd: /etc/dhcp/dhcpd.conf line 8: semicolon expected.
May 7 10:40:37 asterisk dhcpd: options domain-name-servers
May 7 10:40:37 asterisk dhcpd: ^
May 7 10:40:37 asterisk dhcpd: /etc/dhcp/dhcpd.conf line 9: semicolon expected.
May 7 10:40:37 asterisk dhcpd: options domain-name
May 7 10:40:37 asterisk dhcpd: ^
May 7 10:40:37 asterisk dhcpd: Configuration file errors encountered -- exiting
May 7 10:40:37 asterisk dhcpd: Internet Systems Consortium DHCP Server 4.2.2
May 7 10:40:37 asterisk dhcpd: Copyright 2004-2011 Internet Systems Consortium.
May 7 10:40:37 asterisk dhcpd: All rights reserved.
May 7 10:40:37 asterisk dhcpd: For info, please visit https://www.isc.org/software/dhcp/
May 7 10:40:37 asterisk dhcpd: /etc/dhcp/dhcpd.conf line 5: semicolon expected.
May 7 10:40:37 asterisk dhcpd: options subnet-mask
May 7 10:40:37 asterisk dhcpd: ^
May 7 10:40:37 asterisk dhcpd: /etc/dhcp/dhcpd.conf line 6: semicolon expected.
May 7 10:40:37 asterisk dhcpd: options broadcast-address
May 7 10:40:37 asterisk dhcpd: ^
May 7 10:40:37 asterisk dhcpd: /etc/dhcp/dhcpd.conf line 7: semicolon expected.
May 7 10:40:37 asterisk dhcpd: options routers
May 7 10:40:37 asterisk dhcpd: ^
May 7 10:40:37 asterisk dhcpd: /etc/dhcp/dhcpd.conf line 8: semicolon expected.
May 7 10:40:37 asterisk dhcpd: options domain-name-servers
May 7 10:40:37 asterisk dhcpd: ^
May 7 10:40:37 asterisk dhcpd: /etc/dhcp/dhcpd.conf line 9: semicolon expected.
May 7 10:40:37 asterisk dhcpd: options domain-name
May 7 10:40:37 asterisk dhcpd: ^
May 7 10:40:37 asterisk dhcpd: Configuration file errors encountered -- exiting
May 7 10:40:49 asterisk dhcpd: Wrote 0 leases to leases file.
May 7 10:40:49 asterisk dhcpd:
May 7 10:40:49 asterisk dhcpd: No subnet declaration for eth2 (no IPv4 addresses).
May 7 10:40:49 asterisk dhcpd: ** Ignoring requests on eth2. If this is not what
May 7 10:40:49 asterisk dhcpd: you want, please write a subnet declaration
May 7 10:40:49 asterisk dhcpd: in your dhcpd.conf file for the network segment
May 7 10:40:49 asterisk dhcpd: to which interface eth2 is attached. **
May 7 10:40:49 asterisk dhcpd:
May 7 10:40:49 asterisk dhcpd:
May 7 10:40:49 asterisk dhcpd: Not configured to listen on any interfaces!
首先要做的是启用 IP 转发。这可以通过使用
然后,我们将添加一条规则告诉转发流量
最后,我们要求 IPtables 伪装
编辑 1
安装
配置
sudo nano -w /etc/dhcp/dhcpd.conf
重启服务