|
Linux debian 2.6.8-2-686 的内核
关闭了ipv6模块
每次开机都不能上网,用dpkg-reconfigure etherconf 配置一下就行了
在/etc/network/interfaces设了ip后
## etherconf DEBCONF AREA. DO NOT EDIT THIS AREA OR INSERT TEXT BEFORE IT.
auto lo
iface lo inet loopback
iface eth0 inet static
address 211.83.149.178
netmask 255.255.254.0
broadcast 211.83.149.255
gateway 211.83.149.254
### END OF DEBCONF AREA. PLACE YOUR EDITS BELOW; THEY WILL BE PRESERVED.
用/etc/init.d/networking restart
debian:~# /etc/init.d/networking restart
Setting up IP spoofing protection: rp_filter.
Reconfiguring network interfaces...ifup: interface lo already configured
done.
debian:~# ping 211.83.149.254
connect: Network is unreachable
networking中的内容:
#!/bin/sh
#
# manage network interfaces and configure some networking options
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
if ! [ -x /sbin/ifup ]; then
exit 0
fi
spoofprotect_rp_filter () {
# This is the best method: turn on Source Address Verification and get
# spoof protection on all current and future interfaces.
if [ -e /proc/sys/net/ipv4/conf/all/rp_filter ]; then
for f in /proc/sys/net/ipv4/conf/*/rp_filter; do
echo 1 > $f
done
return 0
else
return 1
fi
}
spoofprotect () {
echo -n "Setting up IP spoofing protection: "
if spoofprotect_rp_filter; then
echo "rp_filter."
else
echo "FAILED."
fi
}
ip_forward () {
if [ -e /proc/sys/net/ipv4/ip_forward ]; then
echo -n "Enabling packet forwarding..."
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "done."
fi
}
syncookies () {
if [ -e /proc/sys/net/ipv4/tcp_syncookies ]; then
echo -n "Enabling TCP/IP SYN cookies..."
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
echo "done."
fi
}
doopt () {
optname=$1
default=$2
opt=`grep "^$optname=" /etc/network/options`
if [ -z "$opt" ]; then
opt="$optname=$default"
fi
optval=${opt#$optname=}
if [ "$optval" = "yes" ]; then
eval $optname
fi
}
case "$1" in
start)
doopt spoofprotect yes
doopt syncookies no
doopt ip_forward no
echo -n "Configuring network interfaces..."
ifup -a
echo "done."
;;
stop)
if sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\1 \2/p' /proc/mounts |
grep -q "^/ nfs$"; then
echo "NOT deconfiguring network interfaces: / is an NFS mount"
elif sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\1 \2/p' /proc/mounts |
grep -q "^/ smbfs$"; then
echo "NOT deconfiguring network interfaces: / is an SMB mount"
elif sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\2/p' /proc/mounts |
grep -qE '^(nfs[1234]?|smbfs|ncp|ncpfs|coda|cifs)$'; then
echo "NOT deconfiguring network interfaces: network shares still mounted."
else
echo -n "Deconfiguring network interfaces..."
ifdown -a --exclude=lo
echo "done."
fi
;;
force-reload|restart)
doopt spoofprotect yes
doopt syncookies no
doopt ip_forward no
echo -n "Reconfiguring network interfaces..."
ifdown -a --exclude=lo
ifup -a
echo "done."
;;
*)
echo "Usage: /etc/init.d/networking {start|stop|restart|force-reload}"
exit 1
;;
esac
exit 0
问题出在哪??? |
|