各种linux系统配置多IP方法整理
来源:互联网 发布:志鸿优化系列赢在高考 编辑:程序博客网 时间:2024/06/17 09:05
CentOS下添加IP的方法
一、添加单个IP的方法:
使用cp命令复制一个eth0的文件,新的文件名为eth0:0 ,然后用nano编辑此文件。不习惯用nano的可以用vi等命令。打开文件后编辑:
文件编辑完之后,运行:
用ifconfig看新的IP是否已经加上。
二、批量添加IP:
在/etc/sysconfig/network-scripts下创建一个range文件,也可以用vi等编辑
无类域间路由(CIDR)的子网掩码设置参考:http://www.taohost.net/tools/subnet.htm
/29 (5 usable) NETMASK = 255.255.255.248
/28 (13 usable) NETMASK = 255.255.255.240
/27 (29 usable) NETMASK = 255.255.255.224
/26 (61 usable) NETMASK = 255.255.255.192
/25 (125 usable) NETMASK = 255.255.255.128
/24 (253 usable) NETMASK = 255.255.255.0
三、为一块新网卡配置IP地址的方法:
如果是为第二块网卡配IP,在/etc/sysconfig/network-scripts目录下编辑一个ifcfg-eth1的文件:
修改一下IPADDR,NETMASK和GATEWAY的参数。
运行:
/etc/init.d/network reload
一、添加单个IP的方法:
使用cp命令复制一个eth0的文件,新的文件名为eth0:0 ,然后用nano编辑此文件。不习惯用nano的可以用vi等命令。打开文件后编辑:
文件编辑完之后,运行:
用ifconfig看新的IP是否已经加上。
二、批量添加IP:
在/etc/sysconfig/network-scripts下创建一个range文件,也可以用vi等编辑
无类域间路由(CIDR)的子网掩码设置参考:http://www.taohost.net/tools/subnet.htm
/29 (5 usable) NETMASK = 255.255.255.248
/28 (13 usable) NETMASK = 255.255.255.240
/27 (29 usable) NETMASK = 255.255.255.224
/26 (61 usable) NETMASK = 255.255.255.192
/25 (125 usable) NETMASK = 255.255.255.128
/24 (253 usable) NETMASK = 255.255.255.0
三、为一块新网卡配置IP地址的方法:
如果是为第二块网卡配IP,在/etc/sysconfig/network-scripts目录下编辑一个ifcfg-eth1的文件:
修改一下IPADDR,NETMASK和GATEWAY的参数。
运行:
/etc/init.d/network reload
用ifconfig看新的IP是否已经加上。
Linux FreeBSD服务器添加IP的方法
往FreeBSD添加IP的方法:
vi /etc/rc.conf
First line is the main ip address + subnet mask
Second line and thereafter use the 'alias' in the config line and netmask of
255.255.255.255 and proper broadcast ip.
ALso, may not be fxp0, might be sis0, rltk0, etc..
ifconfig_fxp0="inet 10.10.10.34 netmask 255.255.255.248"
ifconfig_fxp0_alias0="inet 10.10.10.35 netmask 255.255.255.255"
ifconfig_fxp0_alias1="inet 10.10.10.36 netmask 255.255.255.255"
ifconfig_fxp0_alias2="inet 10.10.10.37 netmask 255.255.255.255"
etc..
Also you can run /stand/sysconfig
Choose Configure, Networking, Interfaces, then nic card ( fxp0, rltk, dlink,
rl0, vne, etc...)
vi /etc/rc.conf
First line is the main ip address + subnet mask
Second line and thereafter use the 'alias' in the config line and netmask of
255.255.255.255 and proper broadcast ip.
ALso, may not be fxp0, might be sis0, rltk0, etc..
ifconfig_fxp0="inet 10.10.10.34 netmask 255.255.255.248"
ifconfig_fxp0_alias0="inet 10.10.10.35 netmask 255.255.255.255"
ifconfig_fxp0_alias1="inet 10.10.10.36 netmask 255.255.255.255"
ifconfig_fxp0_alias2="inet 10.10.10.37 netmask 255.255.255.255"
etc..
Also you can run /stand/sysconfig
Choose Configure, Networking, Interfaces, then nic card ( fxp0, rltk, dlink,
rl0, vne, etc...)
Linux Debian 服务器添加IP的方法!
Debian 服务器添加IP的方法!
To add secondary ips in debian do:
edit /etc/network/interfaces and add below
auto eth0:0
iface eth0:0 inet static
address 10.10.10.3
netmask 255.255.255.0
auto eth0:1
iface eth0:1 inet static
address 10.10.10.4
netmask 255.255.255.0
修改 Debian Linux server 主IP
----------------------------------------------
vi /etc/hostname
vi /etc/hosts
vi /etc/network/interfaces
and edit the entries below.
auto eth0
iface eth0 inet static
address 67.159.5.28
netmask 255.255.255.0
network 67.159.5.0
BROADCAST 67.159.5.255
gateway 67.159.5.1
then reboot with 'shutdown -r now' or /etc/init.d/networking restart
To add secondary ips in debian do:
edit /etc/network/interfaces and add below
auto eth0:0
iface eth0:0 inet static
address 10.10.10.3
netmask 255.255.255.0
auto eth0:1
iface eth0:1 inet static
address 10.10.10.4
netmask 255.255.255.0
修改 Debian Linux server 主IP
----------------------------------------------
vi /etc/hostname
vi /etc/hosts
vi /etc/network/interfaces
and edit the entries below.
auto eth0
iface eth0 inet static
address 67.159.5.28
netmask 255.255.255.0
network 67.159.5.0
BROADCAST 67.159.5.255
gateway 67.159.5.1
then reboot with 'shutdown -r now' or /etc/init.d/networking restart
0 0
- 各种linux系统配置多IP方法整理
- 各种linux系统配置多IP方法整理
- linux系统配置静态IP
- Linux查看系统配置常用命令整理
- linux 系统配置2个IP
- redhat linux系统配置方法
- Linux系统配置静态IP的方式
- Linux系统配置NFS服务器的方法
- linux上MySQL修改密码的各种方法,yc整理
- 在linux下操作pcap文件的各种方法整理
- 笔记:Linux系统配置ip地址和DNS+tftp
- 关于linux suse 系统配置ssh防火墙ip规则
- Linux系统配置
- linux系统配置
- Linux系统配置
- linux 系统配置
- linux 系统配置
- Linux系统配置
- UVALive - 4294 Shuffle 映射+取反+最大区间覆盖
- 2017年前思绪整理
- 九度 oj 题目1149:子串计算
- 源码安装PHP扩展mysqli
- 未完成呀
- 各种linux系统配置多IP方法整理
- LeetCode 167. Two Sum II - Input array is sorted
- 0121
- 2017年要学习的三个CSS新特性
- 10G/11G/12cr1版本中backup archivelog命令是否会触发归档current logfile操作
- gcc 程序内存使用分析
- 在macOS 10.12 上编译 Android 5.1
- FBI树(提高组)
- Makefile讲解