http://linux.chinaunix.net/bbs/archiver/?tid-1137337.html
关注和试用LINUX很长时间了,但较少实际用起来,刚好单位需一个路由器,有闲置老机,提升下自己实战能力吧!网上文章好多笔误,因此有些小波折,希望把这次经历总结下,为了忘却的纪念。
安装好UBUNTU SERVER 8.04后,设置双网卡:eth0为外网网卡,eth1为内网网卡,
sudo vi /etc/network/interfaces
auto eth0
iface eth0 inet static
address 外网网卡IP
netmask 子网掩码
gateway 网关
auto eth1
iface eth1 inet static
address 内网网卡IP
netmask 子网掩码
sudo /etc/init.d/networking restart
还有设置DNS服务器
sudo vi /etc/resolv.conf(实际系统默认的并不存在resolv.conf该文件,属于自己创建)
nameserver 主DNS
nameserver 后备DNS
要想使LINUX系统达到这种目的,首先得查看LINUX系统的内核中是否打开了IP转发功能,可以通过下列命令来查看:
sudo cat /pr