Ubuntu 网卡ip设置 ,dhcp , 自定义,双ip
2013-01-27 15:06
393 查看
一、网卡地址配置
Ubuntu的网络配置文件是:/etc/network/interfaces
1、以DHCP 方式配置网卡
auto eth0
iface eth0 inet dhcp
用sudo /etc/init.d/networking restart命令使网络设置生效
2、为网卡配置静态IP地址
sudo vi /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
sudo /etc/init.d/networking restart
3、设定第二个IP地址(虚拟IP地址)
sudo vi /etc/network/interfaces
auto eth0:1
iface eth0:1 inet static
address 192.168.1.101
netmask 255.255.0
gateway 192.168.1.1
sudo /etc/init.d/networking restart
4、设置主机名称(hostname)
使用下面的命令来查看当前主机的主机名称:
sudo /bin/hostname
使用下面的命令来设置当前的主机名称:
sudo /bin/hostname newname
5、配置DNS
(1) /etc/hosts中加入一些主机名称和这些主机名称对应的IP地址,这是本机的静态查询
(2) /etc/resolv.conf
nameserver *.*.*.*
6.双网卡双IP(应用情况较多,一般为一个内网一个为外网)
auto eth0
iface eth0 inet static
address IP
netmask 子网掩码
gateway 网关
auto eth1
iface eth1 inet static
address IP
netmask 子网掩码
gateway 网关
Ubuntu的网络配置文件是:/etc/network/interfaces
1、以DHCP 方式配置网卡
auto eth0
iface eth0 inet dhcp
用sudo /etc/init.d/networking restart命令使网络设置生效
2、为网卡配置静态IP地址
sudo vi /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
sudo /etc/init.d/networking restart
3、设定第二个IP地址(虚拟IP地址)
sudo vi /etc/network/interfaces
auto eth0:1
iface eth0:1 inet static
address 192.168.1.101
netmask 255.255.0
gateway 192.168.1.1
sudo /etc/init.d/networking restart
4、设置主机名称(hostname)
使用下面的命令来查看当前主机的主机名称:
sudo /bin/hostname
使用下面的命令来设置当前的主机名称:
sudo /bin/hostname newname
5、配置DNS
(1) /etc/hosts中加入一些主机名称和这些主机名称对应的IP地址,这是本机的静态查询
(2) /etc/resolv.conf
nameserver *.*.*.*
6.双网卡双IP(应用情况较多,一般为一个内网一个为外网)
auto eth0
iface eth0 inet static
address IP
netmask 子网掩码
gateway 网关
auto eth1
iface eth1 inet static
address IP
netmask 子网掩码
gateway 网关
相关文章推荐
- Ubuntu 10.10 单网卡多IP设置
- CentOS设置网卡成DHCP动态获取IP
- 在 Ubuntu 15.10 上为单个网卡设置多个 IP 地址
- centos 和 ubuntu 下单网卡设置多个IP
- 给windows和ubuntu单网卡设置双ip…
- Ubuntu里网卡IP设置
- 使用udhcpc能获取到DHCP自动分配的IP,但是该IP却没有设置到网卡上
- Linux下单网卡设置双ip,ubuntu设置双IP
- ubuntu双网卡双IP设置并实现同时访问外网的功能
- Ubuntu 网卡ip地址设置参考
- Ubuntu单网卡设置多IP
- 联想Y510P ubuntu14.10双网卡(网卡双IP设置),双显卡设置
- CentOS设置网卡成DHCP动态获取IP
- centos 和 ubuntu 下单网卡设置多个IP
- 使用udhcpc能获取到DHCP自动分配的IP,但是该IP却没有设置到网卡上
- Linux下单网卡设置双ip,ubuntu设置双IP
- Ubuntu 设置网卡固定IP
- Ubuntu网卡IP设置
- 单网卡设置双IP(ubuntu,debian)
- Ubuntu里网卡IP设置的步骤&/etc/passwd文件