引言:
由安装两块网卡的linux系统中引起网络不通想到的
(原创)
一天,小王突然急匆匆的来找我,他说:“我在机子上刚装的redhat怎么老也ping不通服务器,我网卡的驱动都安装了,ping自己的两块网卡的IP都能通,可就时访问不了服务器。
摘要:
这是我正在使用的一段备份脚本 mybackup.sh
在redhat linux 7.2 下运行正常
mybackup.sh
[code:1:5c9c59b4c7]
#!/bin/sh
umount /mnt/bak
mount /dev/sdb1 /mnt/bak
if [ `date +%d` = 01 ] #每月1号进行完全备份
then
bakdir="/mnt/bak/daybak/month/"`......
摘要:
目录属性里链接数具体指的是什么?如这里的9。
drwxr-xr-x 9 root root 4096 4月 18 16:57 home
sunny~tea 回复于:2004-04-18 18:37:24
[color=darkblue:be64c99ec1]就是inode数,也可以理解为文件数吧![/color:be64c99ec1]
弱智 回复于:2004-04-18 19:15:37
楼上的错误。man ls:
......
(原创)由安装两块网卡的linux系统中引起网络不通想到的。
由安装两块网卡的linux系统中引起网络不通想到的
【相关文章:
解析Linux特殊文件】 【扩展阅读:
把已存在的u1用户加到已存在的组g1中如】 (原创)
【扩展信息:
请教mysql的root口令问题。】
一天,小王突然急匆匆的来找我,他说:“我在机子上刚装的redhat怎么老也ping不通服务器,我网卡的驱动都安装了,ping 自己的两块网卡的ip都能通,可就时访问不了服务器。我输入http://172.31.0.101就提示‘当试图与172.31.0.101联系时,连接被拒绝’”
我来到小王的机器前查看了一下网络配置。
[root@rhas root]# ifconfig -a
eth0 link encap:ethernet hwaddr 00:d0:b7:c6:8f:1d
inet addr:172.31.0.200 bcast:172.31.0.255 mask:255.255.255.0
up broadcast running multicast mtu:1500 metric:1
rx packets:16 errors:0 dropped:0 overruns:0 frame:0
tx packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
rx bytes:1306 (1.2 kb) tx bytes:210 (210.0 b)
interrupt:10 base address:0xe800 memory:d9100000-d9100038
eth1 link encap:ethernet hwaddr 00:01:03:40:a4:15
inet addr:172.31.0.201 bcast:172.31.0.255 mask:255.255.255.0
up broadcast multicast mtu:1500 metric:1
rx packets:0 errors:0 dropped:0 overruns:0 frame:0
tx packets:32 errors:0 dropped:0 overruns:0 carrier:32
collisions:0 txqueuelen:1000
rx bytes:0 (0.0 b) tx bytes:1920 (1.8 kb)
interrupt:11 base address:0xec00
lo link encap:local loopback
inet addr:127.0.0.1 mask:255.0.0.0
up loopback running mtu:16436 metric:1
rx packets:1430 errors:0 dropped:0 overruns:0 frame:0
tx packets:1430 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
rx bytes:143776 (140.4 kb) tx bytes:143776 (140.4 kb)
[root@rhas root]# route -n
kernel ip routing table
destination gateway genmask flags metric ref use iface
172.31.0.0 0.0.0.0 255.255.255.0 u 0 0 0 eth1
172.31.0.0 0.0.0.0 255.255.255.0 u 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 u 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 u 0 0 0 lo
[color=red:c9e033eb60]0.0.0.0 172.31.0.254 0.0.0.0 ug 0 0 0 eth1[/color:c9e033eb60]
到这一步我猜想网线可能没有插到默认网关对应的网卡上即eth1(嗨!小王的机器被镶在桌子里不太好挪动。连他自己把网线插在那块卡上都不知道了。)
接着我在一机子上ping 172.31.0.200与172.31.0.201,在小王的机器监听
[root@rhas root]# tcpdump
tcpdump: listening on eth0
19:32:29.109283 172.31.0.101 > 172.31.0.200: icmp: echo request (df)
19:32:30.109337 172.31.0.101 > 172.31.0.200: icmp: echo request (df)
19:32:31.109418 172.31.0.101 > 172.31.0.200: icmp: echo request (df)
19:32:42.670162 172.31.0.101 > 172.31.0.201: icmp: echo request (df)
19:32:43.670218 172.31.0.101 > 172.31.0.201: icmp: echo request (df)
19:32:44.670291 172.31.0.101 > 172.31.0.201: icmp: echo request (df)
........................
........................
19:32:56.671040 172.31.0.101 > 172.31.0.201: icmp: echo request (df)
19:32:57.671064 172.31.0.101 > 172.31.0.201: icmp: echo request (df)
19:32:58.671133 172.31.0.101 > 172.31.0.201: icmp: echo request (df)
19:32:59.671187 172.31.0.101 > 172.31.0.201: icmp: echo request (df)
19:33:00.671257 172.31.0.101 > 172.31.0.201: icmp: echo request (df)
19:33:01.671349 172.31.0.101 > 172.31.0.201: icmp: echo request (df)
19:33:02.671377 172.31.0.101 > 172.31.0.201: icmp: echo request (df)
19:33:03.671441 172.31.0.101 > 172.31.0.201: icmp: echo request (df)
36 packets received by filter
0 packets dropped by kernel
没有回应,看一下firewall的设置。
[root@rhas3 123]# iptables -l -n
chain input (policy accept)
target prot opt source destination
chain forward (policy accept)
target prot opt source destination
chain output (policy accept)
target prot opt source destination
又不是防火墙的问题,想了一下,我越发肯定刚才的想法是正确的。
[root@rhas root]# cat /etc/modules.conf
alias eth0 e100
[color=red:c9e033eb60]alias eth1 3c59x[/color:c9e033eb60]
alias sound-slot-0 via82cxxx_audio
post-install sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -l >/dev/null 2>&1 || :
pre-remove sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -s >/dev/null 2>&1 || :
alias usb-controller usb-uhci
[root@rhas root]#mii-tool
eth0: negotiated 100basetx-fd flow-control, link ok
eth1: no linkk
找到原因了,果然是插反了。既然不方便换端口最简单的就把eth1即3com网卡宕调就ok了
当然也可以把两块网卡分配在不同的网段。
[root@rhas root]# vi /etc/sysconfig/network-scripts/ifcfg-eth1
# 3com corporation|3c905c-tx/tx-m [tornado]
device=eth1
bootproto=static
broadcast=172.31.0.255
hwaddr=00:01:03:40:a4:15
ipaddr=172.31.0.201
netmask=255.255.255.0
network=172.31.0.0
[color=red:c9e033eb60]onboot=no[/color:c9e033eb60]
type=ethernet~
~
~
"/etc/sysconfig/network-scripts/ifcfg-eth1" [已转换] 10l, 207c 9,1 全部
或者在启动哦时根本不要加载3com网卡的驱动哦。
从启动我们的网络
[root@rhas root]# service network restart
正在关闭接口 eth0: [ 确定 ]
关闭环回接口: [ 确定 ]
设置网络参数: [ 确定 ]
弹出环回接口: [ 确定 ]
弹出界面 eth0:
[ 确定 ]
[root@rhas root]#
[root@rhas root]#
[root@rhas root]#
[root@rhas root]# ifconfig
eth0 link encap:ethernet hwaddr 00:d0:b7:c6:8f:1d
inet addr:172.31.0.200 bcast:172.31.0.255 mask:255.255.255.0
up broadcast running multicast mtu:1500 metric:1
rx packets:68 errors:0 dropped:0 overruns:0 frame:0
tx packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
rx bytes:5560 (5.4 kb) tx bytes:504 (504.0 b)
interrupt:10 base address:0xe800 memory:d9100000-d9100038
lo link encap:local loopback
inet addr:127.0.0.1 mask:255.0.0.0
...
下一页 摘要:
我的mrtg实战
一直想搞通mrtg,可是每次都无功而返,在得到platinum老大的提示后,才锰然惊醒,终于做好了mrtg,不敢独享,特写出来,以飨和我一样有过迷惑的朋友。这里再次感谢platinum.
系统环境:redhat9.0
必备软件:
系统必须已经安装以下软件,这些软件都可以在光盘里找的到:
gd-1.8.4-11
gd-devel-1.8.4-11
libpng-1.2.2-16
libpng-devel-1.2.2-16
......