嵌入式设置路由 route: SIOCADDRT: Network is unreachable
1、我使用的TQ2440(256M nand),系统是linux2.6的;
2、修改/etc/net.conf的内容
IPADDR=192.168.180.15
NETMASK=255.255.255.224
GATEWAY=192.168.180.129
MAC=00:00:23:01:14:E7
3、调用net_set,系统提示
Try to bring eth0 interface up ...
ifconfig eth0 hw ether 00:00:23:01:14:E7
eth0: link down
ifconfig eth0 192.168.180.15 netmask 255.255.255.224 up
route: SIOCADDRT: Network is unreachable
add default gw 192.168.180.129
Done
提示我networking is unreachable
4、调用route命令查看,系统返回
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.180.0 * 255.255.255.224 U 0 0 0 eth0
5、如果我修改/etc/net.conf 中的GATEWAY=192.168.180.12,确保最后一段的ip不超过IPADDRESS中最后一段的ip的长度
那么就不会出现 networking is unreachable 的问题
求帮助