linux 获取指定网卡ip地址,获取上级路由的ip

2190阅读 0评论2016-03-08 sheepbao
分类:LINUX

将wlan0替换成你想要的网卡
  1. ifconfig wlan0 |grep -e 'inet addr' |awk '{print $2}'|grep -oE '[0-9.]*'
获取上级路由ip

  1. route |grep default |awk '{print $2}'

上一篇:centos 6.4 搭建lamp
下一篇:ubnutu 15.10 安装sogoupinyin