Linux根据MAC地址自动设置IP
Linux根据MAC地址自动设置IP
#!/bin/sh #============config============
route_defa=60.12.70.65
addr_ip=60.12.70.82/
link_mac=a4:bf::::ea #============start============
link_name=`ip link show|grep -B1 $link_mac|awk -F': ' '{print $2}'`
ip addr flush dev $link_name
ip addr add $addr_ip dev $link_name
ip link set $link_name up
ip route replace default via $route_defa table default
echo $link_name
Linux根据MAC地址自动设置IP的更多相关文章
- linux ip地址自动获取,ip地址…
linux ip地址自动获取,ip地址手动设置(图文解释) 2011-04-19 16:19:31| 分类: 服务器(appache/n | 标签: |字号大中小 订阅 linux ip地址自动获取( ...
- Linux修改MAC地址方法
Linux修改MAC地址方法 - Linux modifies MAC address method ifconfig wlan0 down ifconfig wlan0 hw ether MAC地址 ...
- Linux常用命令3--如何设置IP地址?如何更改系统时间?
Linux常用命令 系统状态监控 [1]ps:用于显示当前系统中运行的进程. 语法:ps [-option]:常用的参数有:-a;-u;-x;-e;-f. -a:显示所有进程: -u:显示所有用户: ...
- java工具类,在Windows,Linux系统获取电脑的MAC地址、本地IP、电脑名
package com.cloudssaas.util; import java.io.BufferedReader; import java.io.IOException; import java. ...
- linux 通过 mac地址 查询 ip 和 清除arp 缓存
问题重述: 今天,突然找不到vm 的ip 了,但是可以从网卡状态上看到其 mac 地址,并且确定主机是启动状态,网络状态良好(后来发现因为子网掩码的问题,导致虚拟机和网关之间不通信,从而导致其他网络的 ...
- 自动设置IP地址bat脚本
自动获取IP及DNS: netsh interface ip set address name="本地连接" source=dhcpnetsh interface ip set d ...
- Linux 桥接网络不自动分配IP的问题
之前遇到过好多次,知道什么原因就是忘了命令怎么敲,还要去搜索,写一遍加强下记忆,并总结下. 情况一 :网卡冲突问题 1 , 网卡问题 有安装过oracle VM VirtualBox 的,会和VMwa ...
- Linux Shell脚本之自动修改IP
作为一名Linux SA,日常运维中很多地方都会用到脚本,而服务器的ip一般采用静态ip或者MAC绑定,当然后者比较操作起来相对繁琐,而前者我们可以设置主机名.ip信息.网关等配置.修改成特定的主机名 ...
- Azure上Linux虚拟机Mac地址的持久化
有些用户在使用Azure Linux 虚拟机安装软件时,有些软件的license会和当前系统的mac地址绑定,那么在Azure VM重启,reszie(改变尺寸大小),停止然后再启动的时候,虚拟机的M ...
随机推荐
- [lightoj P1151] Snakes and Ladders
1151 - Snakes and Ladders Time Limit: 2 second(s) Memory Limit: 32 MB 'Snakes and Ladders' or 'Sh ...
- es6中...是什么意思。
1. var set = new Set([1, 2, 3, 4, 4,4,4,4,2,2,2]) set=[...set] 2. let [head, ...tail] = [1, 2, 3, 4] ...
- commons-lang3工具类学习(二)
三.BooleanUtils 布尔工具类 and(boolean... array) 逻辑与 BooleanUtils.and(true, true) = true Boolea ...
- PDF 补丁丁 0.6.0.3282 版发布(修复内存漏洞)
补丁丁的新测试版修复了旧版在导出图片.分析文件结构时的内存漏洞. 对于希望表达对本软件感情的用户,可点击“帮助”菜单的“关于本程序及作者”命令,用微信扫描里面的二维码表达您的谢意. 新的测试版正在制作 ...
- C# 语句中的各种单例模式代码
1.非线程安全(经典模式),但没有考虑线程安全,在多线程时可能会出问题,不过还从没看过出错的现象. /// <summary> /// 单例模式的实现 /// </summary&g ...
- JavaScript 中repalce的使用
把Paul Pauline pual Paula Paul中的Paul替换成Ringo <!DOCTYPE html> <html> <body> <butt ...
- go 语言如何跨平台编译
以evio源码的分析来说明: 我们看到在有些文件的头部有这样一个标识:文件链接:https://github.com/tidwall/evio/blob/master/evio_unix.go // ...
- open live writer安装教程和账号配置
第一步:Open Live Writer软件下载.官方地址:http://openlivewriter.org/ 第二步:双击安装文件(OpenLiveWriterSetup.exe),然后点击下一步 ...
- iOS Runtime 实操练习
iOS Runtime 知识详解: http://yulingtianxia.com/blog/2014/11/05/objective-c-runtime/ 一般可以运行Runtime进行以下操作 ...
- Cannot find ./catalina.sh The file is absent or does not have execute permission This file is nee
从tomcat官网上下载了apache-tomcat-5.5.36.zip,在window xp系统里面解压以后,直接放在了linux服务器上. 进入tomcat/bin目录,执行启动的时候出现如下错 ...