ubuntu 启动时 设置多个ip 修改mac 网关 。。。
来源:互联网 发布:淘宝 补全会员名 编辑:程序博客网 时间:2024/06/05 03:57
有时开发时要用到多个ip,还要改mac,在 /etc/network/interfaces这样写就可以达到 设置多个ip,改mac的目的
vi /etc/network/interfaces
auto loiface lo inet loopback
auto eth0
#auto eth0 inet dhcp
iface eth0 inet static
hwaddress ether 00:6d:04:60:2f:4a //设置mac
address 192.168.0.222 //第一个ip
netmask 255.255.255.0
gateway 192.168.0.1 //第一个网关
auto eth0:0 //第二个ip
iface eth0:0 inet static
address 192.168.1.222
netmask 255.255.255.0
gateway 192.168.1.1
auto eth0:1 //第三个ip
iface eth0:1 inet static
address 10.10.0.2
netmask 255.255.255.0
gateway 10.10.0.1
dns-nameserever 8.8.4.4 //dns
dns-nameserver 192.168.0.1
改后sudo /etc/init.d/networking restart 让设置生效
当然用命令也是可以改ip,mac的
改mac地址
ifconfig eth0 down
ifconfig eth0 hw ether 00:aa:bb:cc:dd:ee
ifconfig eth0 up
ifconfig eth0 192.168.0.22 netmask 255.255.255.0 //改ip
ifconfig eth0:0 192.168.1.22 netmask 255.255.255.0 //添加一个ip
route add default gw 192.168.0.1 ///添网关
不过用改dns的 命令我还没发现。。。。有人发现可给我说下
- ubuntu 启动时 设置多个ip 修改mac 网关 。。。
- Ubuntu 修改ip 网关
- ubuntu 设置IP,设置网关
- ubuntu 设置IP,设置网关
- ubuntu 设置IP,设置网关
- ubuntu 设置IP,设置网关
- linux设置网关修改ip
- ubuntu 命令修改IP和网关
- ubuntu修改IP地址和网关
- linux设置网关修改ip相关
- Linux CentOS修改网卡IP/网关设置
- Linux CentOS修改网卡IP/网关设置
- 设置ubuntu ip网关DNS等等一切
- Ubuntu Server设置IP地址、网关、DNS
- Ubuntu设置IP地址、网关、DNS
- CentOS和Ubuntu设置或修改网络配置(IP&网关&DNS)
- CentOS 设置网络(修改IP&修改网关&修改DNS)
- CentOS 设置网络(修改IP&修改网关&修改DNS)
- WINCE6.0建立共享文件夹
- MultiProcess进程池的设计(三)主进程和子进程间的通信
- phpcms模板的使用方法
- First
- ubuntu SVN命令大全
- ubuntu 启动时 设置多个ip 修改mac 网关 。。。
- 四级之翻译备考
- _CRT_SECURE_NO_WARNINGS
- ilog opl 存取外部文件
- HDU-2063 过山车
- stagefright与opencore对比
- Ogre Timer 类 解析
- extends Thread 与 implements Runnable 的区别
- 视频采集方式比较