I recently used ifconfig en1 1.2.3.4 to set the IP address of a network interface (specifically, the wireless card) on a Mac… How can I remove/unset it?

Using the graphical network configuration tool doesn't seem to change (or even be aware of) this address - when I use it to manually set an address, a second address is added to the device.

For example, right now ifconfig shows:

en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 00:23:xx:xx:xx:xx
inet 192.168.141.99 netmask 0xffffff00 broadcast 192.168.141.255
inet 192.168.1.112 netmask 0xffffff00 broadcast 192.168.1.255
media: autoselect
status: active

The first address - 141.99 - is the address I manually set. The second address — 1.112 — is the address assigned by my network's DHCP server.

Use delete:

ifconfig en1 delete 192.168.141.99

Sounds like you are looking to change the device en1 from 'static' to 'dhcp'. To do this perform the following:

sudo ifconfig en1 BOOTP
sudo ifconfig en1 DHCP

After making the config changes you will need to bring that interface down and back up:

sudo ifconfig en1 down
sudo ifconfig en1 up

origina:
http://apple.stackexchange.com/questions/25895/how-do-i-unset-an-ip-address-set-with-ifconfig

[Non-original]OS X How do I unset an IP address set with ifconfig?的更多相关文章

  1. [转]Debugging the Mac OS X kernel with VMware and GDB

    Source: http://ho.ax/posts/2012/02/debugging-the-mac-os-x-kernel-with-vmware-and-gdb/ Source: http:/ ...

  2. RASPBERRY PI 外设学习资源

    参考: http://www.siongboon.com/projects/2013-07-08_raspberry_pi/index.html Raspberry Pi         Get st ...

  3. RAC的QA

    RAC: Frequently Asked Questions [ID 220970.1]   修改时间 13-JAN-2011     类型 FAQ     状态 PUBLISHED   Appli ...

  4. NMAP - A Stealth Port Scanner--reference

    http://nmap.org/bennieston-tutorial/ 实例:nmap -sP 192.168.21.* Contents 1  Introduction Nmap is a fre ...

  5. f5会话保持

    B/S架构的建议选择 inset cookie :c/s架构的 建议选择 sorce ip 1.  Introduction to session persistence profiles Using ...

  6. linux作业--第三周

    1.统计出/etc/passwd文件中其默认shell为非/sbin/nologin的用户个数,并将用户都显示出来 [root@localhost ~]# cat /etc/passwd | grep ...

  7. Python标准库之os模块

    1.删除和重命名文件 import os import string def replace(file, search_for, replace_with): # replace strings in ...

  8. python基础课程_学习笔记20:标准库:有些收藏夹——os

    标准库:有些收藏夹 os os模块为您提供访问多个操作系统服务特征. os和它的子模块os.path还包含一些用于检查.构造.删除文件夹和文件的函数,以及一些处理路径的函数. os模块中一些重要函数和 ...

  9. [转]Top 10 DTrace scripts for Mac OS X

    org link: http://dtrace.org/blogs/brendan/2011/10/10/top-10-dtrace-scripts-for-mac-os-x/ Top 10 DTra ...

随机推荐

  1. linux访问windows共享文件夹的两种方法

    有时需要在linux下需要访问windows的共享文件夹,可以使用mount挂载或者使用samba连接. 1.mount挂载 首先创建被挂载的目录: $ mkdir windows 将共享文件夹挂载到 ...

  2. php连接postgresql

    在ubuntu下用php连接postgresql需要下个模块php5-pgsql 连接数据库并显示一张表的内容: <?php #连接数据库 $conn = pg_connect("ho ...

  3. 工作中小知识点汇总(sql)

    1.with(nolock) 在查询表的时候加上它可以增加33%查询效率 例子:SELECT TOP 5 b.UserName,f.issuedDate,r.tktedTime,r.refundSig ...

  4. java通过jdbc连接mysql数据库

    下载mysql驱动包: http://dev.mysql.com/downloads/file.php?id=456317 解压之后里面有个mysql-connector-java-5.1.35-bi ...

  5. javascript string对象的属性与方法

    一 创建string对象 new string('string'); 更直接的定义方法是var str = 'string'; 二 string属性 1.constructor 2.lenght 字符 ...

  6. C++ Primer day 01

    1.标准输入与输出 #include<iostream> int main(){ int v1,v2; std::cout<<"Enter two numbers:& ...

  7. Java 之String.valueOf(obj)

    实例代码如下: String str = null; String uSelectDate = String.valueOf(str); System.out.println("====== ...

  8. C语言中的宏定义

    目录(?)[-] 简单宏定义 带参数的宏 运算符 运算符 宏的通用属性 宏定义中圆括号 创建较长的宏 较长的宏中的逗号运算符 宏定义中的do-while循环do 空操作的定义 预定义宏 C语言中常用的 ...

  9. Redhat关闭SELinux和防火墙的办法(转)

    Redhat使用了SELinux来增强安全,关闭的办法为:1. 永久有效修改 /etc/selinux/config 文件中的 SELINUX="" 为 disabled ,然后重 ...

  10. ListView开发笔记

    一.ListView有背景,ListItem 透明,但是在点击.拖动时变成白色 android:cacheColorHint="#0000"