服务器:192.168.15.11

服务器版本:CentOS release 5.5 (Final)

内核:2.6.18-194.el5xen  x86_64 x86_64 x86_64 GNU/Linux

问题ssh连接失败,接上显示器查看,满屏幕滚动显示vif0.0: received packet with  own address as source address

分析问题解决问题

#查看系统信息

dmesg

vif0.0: received packet with  own address as source address

vif0.0: received packet with  own address as source address

vif0.0: received packet with  own address as source address

printk: 1 messages suppressed.

vif0.0: received packet with  own address as source address

printk: 7 messages suppressed.

vif0.0: received packet with  own address as source address

printk: 2 messages suppressed.

vif0.0: received packet with  own address as source address

printk: 4 messages suppressed.

vif0.0: received packet with  own address as source address

vif0.0: received packet with  own address as source address

vif0.0: received packet with  own address as source address

vif0.0: received packet with  own address as source address

vif0.0: received packet with  own address as source address

vif0.0: received packet with  own address as source address

#查看系统日志

tail -f /var/log/messsge

Aug 17 13:10:31 ldap01 kernel: vif0.0: received packet with  own address as source address

Aug 17 13:10:39 ldap01 kernel: printk: 4 messages suppressed.

Aug 17 13:10:39 ldap01 kernel: vif0.0: received packet with  own address as source address

Aug 17 13:10:41 ldap01 kernel: printk: 2 messages suppressed.

Aug 17 13:10:41 ldap01 kernel: vif0.0: received packet with  own address as source address

Aug 17 13:10:46 ldap01 kernel: printk: 11 messages suppressed.

Aug 17 13:10:46 ldap01 kernel: vif0.0: received packet with  own address as source address

Aug 17 13:10:52 ldap01 kernel: vif0.0: received packet with  own address as source address

Aug 17 13:10:57 ldap01 kernel: printk: 1 messages suppressed.

Aug 17 13:10:57 ldap01 kernel: vif0.0: received packet with  own address as source address

Aug 17 13:11:03 ldap01 kernel: printk: 1 messages suppressed.

Aug 17 13:11:03 ldap01 kernel: vif0.0: received packet with  own address as source address

#查看网络配置

[xuekun@ldap01 ~]$ /sbin/ifconfig

eth0      Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF   #注意观察

          inet addr:172.16.1.11  Bcast:172.16.1.255  Mask:255.255.255.0

          inet6 addr: fe80::220:aff:fe10:fcff/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:136140 errors:0 dropped:0 overruns:0 frame:0

          TX packets:19734 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:11102984 (10.5 MiB)  TX bytes:2350144 (2.2 MiB)

 

eth0:6    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF  #注意观察

          inet addr:10.0.0.6  Bcast:10.0.15.255  Mask:255.255.240.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

 

lo        Link encap:Local Loopback 

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:188 errors:0 dropped:0 overruns:0 frame:0

          TX packets:188 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:15932 (15.5 KiB)  TX bytes:15932 (15.5 KiB)

 

peth0     Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF  #注意观察  

          inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link

          UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1

          RX packets:420980 errors:0 dropped:0 overruns:0 frame:0

          TX packets:32279 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:34869961 (33.2 MiB)  TX bytes:3708085 (3.5 MiB)

          Interrupt:254 Base address:0x4000

 

vif0.0    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF   #注意观察

          inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link

          UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1

          RX packets:31951 errors:0 dropped:0 overruns:0 frame:0

          TX packets:408757 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:3655532 (3.4 MiB)  TX bytes:32287014 (30.7 MiB)

说明:eth0,eth0:6 HWaddr地址是一样,跟vif0.0不能一样,如果一样就是有问题了。

      上述结果已说明存在问题,HWaddr地址都一样,MAC地址重复,所以才会出现满屏的错误。

解决:

    办法一、

mv /etc/sysconfig/network-scripts/ifcfg-eth0 /home/XX/     #备份网卡配置文件

reboot  #重启,自动生成配置文件,MAC地址还是:FE:FF:FF:FF:FF:FF

办法二、

vi /etc/ sysconfig/network-scripts/ifcfg-eth0         #手动指定一个一个MAC地址。

/etc/init.d/networt  restart    #重启网卡,失败,错误提示和屏幕报错一样。

办法三、

ifconfig eth0 down
ifconfig eth0 hw ether 00:20:0A:10:FC:FF
ifconfig eht0 up

启动没有报错,说明没问题,进一步测试。

/etc/init.d/network restart   #重起网络配置,正常,没有报错。

查看网络配置:

ifconfig

eth0      Link encap:Ethernet  HWaddr 00:20:0A:10:FC:FF 

          inet addr:172.16.1.11  Bcast:172.16.1.255  Mask:255.255.255.0

          inet6 addr: fe80::220:aff:fe10:fcff/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:136140 errors:0 dropped:0 overruns:0 frame:0

          TX packets:19734 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:11102984 (10.5 MiB)  TX bytes:2350144 (2.2 MiB)

 

eth0:6    Link encap:Ethernet  HWaddr 00:20:0A:10:FC:FF 

          inet addr:10.0.0.6  Bcast:10.0.15.255  Mask:255.255.240.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

 

lo        Link encap:Local Loopback 

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:188 errors:0 dropped:0 overruns:0 frame:0

          TX packets:188 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:15932 (15.5 KiB)  TX bytes:15932 (15.5 KiB)

 

peth0     Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF 

          inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link

          UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1

          RX packets:420980 errors:0 dropped:0 overruns:0 frame:0

          TX packets:32279 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:34869961 (33.2 MiB)  TX bytes:3708085 (3.5 MiB)

          Interrupt:254 Base address:0x4000

 

vif0.0    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF 

          inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link

          UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1

          RX packets:31951 errors:0 dropped:0 overruns:0 frame:0

          TX packets:408757 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:3655532 (3.4 MiB)  TX bytes:32287014 (30.7 MiB)

有可能用以上办法还是不行,可以尝试以下两种办法:

1、用CentOS5.5构建的Xen domain-0突然发现连接不上网络。用ifup eth0一试,出现以下错误:

Device eth0 has different MAC address than expected, ignoring

把/etc/sysconfig/network-scripts/ifcfg-eth0里的HWADDR那一行comment out后,出现以下信息:

vif0.0 received packet with own address as source address

最后,把/etc/sysconfig/network-scripts/ifcfg-eth0里的

HWADDR=00:xx:xx:xx….
改成
MACADDR=00:xx:xx:xx…

再运行/etc/rc.d/init.d/network restart重启网络服务后,终于可以正常连接网络。

#之后,原来是想再现这个错误,却发现把MACADDR改回HWADDR也可以连接上网络。

2、

Centos/linux重启出现错误信息:
Device eth0 has different MAC address than expected

应该是dmesg 和 eth0 配置文件之间的冲突。

[root@banyue.net ~]# dmesg | grep eth0
divert: allocating divert_blk for eth0
eth0: RTL-8139C+ at 0xd0842000, 40:61:86:ED:25:E7, IRQ 11

[root@banyue.net ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
HWADDR=40:61:86:ED:35:17
ONBOOT=yes
TYPE=Ethernet
IPADDR=192.168.122.101
NETMASK=255.255.255.0
GATEWAY=192.168.122.1
DNS1=192.168.122.1

改正很简单,HWADDR=40:61:86:ED:35:17 改成正确的40:61:86:ED:25:E7 就OK了
HWADDR=40:61:86:ED:25:E7