UBuntu8.04 Server设置路由器
Linux作为路由器的好处是相比专业的路由器设备,费用节省很多,因为硬件通常都是使用旧电脑加上几块网卡,而Linux系统有很多免费的可以使用。并且由于可以自己定制,可以针对企业网络的情况指定灵活的网络管理规则。但是这种做法需要学习很多知识,往往令人生畏。本文总结了自己的个人经验,试图帮助更多的Linux爱好者。
我的设置路由器的方法主要用到了UBuntu设置网卡地址、route命令和iptables的相关知识。用eth0直接连接在Internet上,另外两个通过IP包转发的方式和其他子网通信并因此可以连接Internet。
File Edit Options Buffers Tools Help
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 58.246.17.2
netmask 255.255.255.248
network 58.246.17.0
broadcast 58.246.17.7
gateway 58.246.17.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 210.22.70.3
dns-search longday.com
# The sencond network interface
auto eth1
iface eth1 inet static
address 192.168.10.244
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255
gateway 192.168.10.244
#dns-* options are implemented by the resolvconf package, if installed
我的设置路由器的方法主要用到了UBuntu设置网卡地址、route命令和iptables的相关知识。用eth0直接连接在Internet上,另外两个通过IP包转发的方式和其他子网通信并因此可以连接Internet。
设置网卡
首先给我的三块网卡分配不同的地址:(通过sudo身份编辑/etc/network/interfaces文件)文件内容如下:File Edit Options Buffers Tools Help
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 58.246.17.2
netmask 255.255.255.248
network 58.246.17.0
broadcast 58.246.17.7
gateway 58.246.17.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 210.22.70.3
dns-search longday.com
# The sencond network interface
auto eth1
iface eth1 inet static
address 192.168.10.244
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255
gateway 192.168.10.244
#dns-* options are implemented by the resolvconf package, if installed
Ubuntu 8.04 Server 路由器配置指南

这篇博客详细介绍了如何在Ubuntu 8.04 Server上设置路由器,包括网卡配置、路由设定、IP包转发、端口映射以及FTP设置。此外,还涉及到限制部分用户上网、保存IPTables设置、限制访问特定网站、控制上网时间和流量等网络管理措施。
最低0.47元/天 解锁文章
2336

被折叠的 条评论
为什么被折叠?



