vi /etc/network/interfaces ####加入
auto eth1
iface eth1 inet static
address 192.168.2.100
netmask 255.255.255.0
############pre-up /sbin/ifconfig eth0 up #####eth0 为连接ADSL的接口
sudo vi /etc/sysctl.conf #####把net.ipv4.ip_forward=改为net.ipv4.ip_forward=1
sudo vi /etc/init.d/rc.local ####加入 /etc/rc.local 也行但要写在 exit 0 的前面
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
####dns cache server
$ sudo apt-get install bind9
sudo vi /etc/bind/named.conf.options #####把forwarders 改为电信dns
sudo vi /etc/resovl.conf #####把第一行改为127.0.0.1
sudo /etc/init.d/bind9 restart
$ sudo apt-get install dhcp3-server
DHCP服务器的配置为 /etc/dhcp3/dhcpd.conf
# /etc/init.d/dhcp3-server start
阅读(1438) | 评论(0) | 转发(0) |