ubuntu7.04 组建实验室局域网
由于实验室条件有限,于是使用单网卡双IP组建局域网
在/etc/network/interfaces
auto lo eth0
iface lo inet loopback
#auto eth0
iface eth0 inet static
address 202.114.2.237
netmask 255.255.255.0
gateway 202.114.2.254
#auto eth0:1
iface eth0:1 inet static
address 192.168.20.2
netmask 255.255.255.0
auto eth1
iface eth1 inet dhcp
auto eth2
iface eth2 inet dhcp
auto ath0
iface ath0 inet dhcp
auto wlan0
iface wlan0 inet dhcp
在终端ping 192.168.20.2 正常,局域网内任一PC ping 192.168.20.2 或202.114.2.237正常
ifconfig -a 也能正常看到eth0:1的相关信息
sysctl.conf文件
#
# /etc/sysctl.conf - Configuration file for setting system variables
# See sysctl.conf (5) for information.
#
#kernel.domainname = example.com
net/ipv4/icmp_echo_ignore_broadcasts=1
# the following stops low-level messages on console
kernel.printk = 4 4 1 7
##############################################################3
# Functions previously found in netbase
#
# Uncomment the next line to enable Spoof protection (reverse-path filter)
net.ipv4.conf.default.rp_filter=1
# Uncomment the next line to enable TCP/IP SYN cookies
net.ipv4.tcp_syncookies=1
# Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.conf.default.forwarding=1
# Uncomment the next line to enable packet forwarding for IPv6
#net.ipv6.conf.default.forwarding=1
且使用sysctl -p激活设备
问题为:服务器(Ubuntu)可以正常上网,但局域网内的PC不能正常上网,请各位帮忙,小弟先谢过了!
[已解决][问题]ubuntu 单网卡双IP组建局域网
-
- 帖子: 2
- 注册时间: 2008-05-12 17:21
[已解决][问题]ubuntu 单网卡双IP组建局域网
上次由 guitar402 在 2008-05-12 19:50,总共编辑 1 次。
-
- 帖子: 2
- 注册时间: 2008-05-12 17:21
- lhw828
- 帖子: 2797
- 注册时间: 2007-03-15 16:58
- 来自: 湖北武汉
- 联系:
蛮高深的问题啊
.
Linux下安装QQ的各种办法——2017年3月7日更新——QQ8.8
Linux/Ubuntu学习笔记——用前人的经验,让你快速进入Linux的怀抱
科学上网的姿势,无痛穿越长城
Ubuntu交流QQ群:16308991(500人群)和10993386(500人群)疯狂招人!大家速来!
.