---
title: "ubuntu ipconfig"
author: "seavers"
date: "2013-11-06T13:45:35Z"
tags: []
categories: ["操作系统"]
slug: "ubuntu-ipconfig"
draft: false
lastmod: "2013-11-06T13:47:59Z"
id: 1972028
url: "https://seavers.iteye.com/blog/1972028"
---

sudo vi /sbin/ipconfig


```bash

#! /bin/bash
for word in `ifconfig eth0 | grep "inet addr" | sed  's/          inet addr/addr/g'`; do echo $word | sed 's/:/\t/g'; done
route -n | awk '/UG/ {printf "gateway    %-21s %s\n", $2,$8}' ;
grep nameserver /etc/resolv.conf ;

```




```shell

sudo chmod +x /sbin/ipconfig

ipconfig


```





---------
待改进

支持eth0 与 wlan0
支持dnsmasq