ubuntu ip设置
来源:互联网 发布:ubuntu桌面版什么意思 编辑:程序博客网 时间:2024/06/06 10:56
一.测试网卡是否正常工作
1.ping 127.0.0.1
2.ping gateway
3.ping hostname 可以用hostname命令查看)
二.查看网卡配置(ifconfig)
1.查看DNS,Default getway Sever地址是否正确
三.修改网络配置
1.禁用IPV6
sudo vim /etc/modprobe.d/blacklist.conf
在文档最后添加
blacklist ipv6
2.设置IP
sudo ifconfig eth0 192.168.1.3 netmask 255.255.255.0
3.设置网关
sudo route add default gw 192.168.1.1
4.设置DNS
sudo vim /etc/resolv.conf
在文档中加入
nameserver DNS1
nameserver DNS2
5.重启网络服务
sudo /etc/init.d/networking restart
四.通过修改文件设置网络
1.DHCP
sudo vim /etc/network/interfaces
替换eth0 行
#The primary network interface - use DHCP to find our address
auto eth0
iface eth0 inet dhcp
也可以使用以下命令来获取地址
sudo dhclient eth0
2.静态IP
sudo vim /etc/network/interfaces
替换eth0 行
#The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.3
gateway 192.168.1.1
netmask 255.255.255.0
#network 192.168.1.0
#broadcast 192.168.1.255
3.重启网络
五.设置主机名
sudo /bin/hostname newname
- ubuntu 7.04 IP设置
- Ubuntu网络IP设置
- ubuntu设置静态IP
- Ubuntu设置静态IP
- ubuntu设置ip
- ubuntu设置IP地址
- ubuntu ip设置
- Ubuntu设置静态 IP
- Ubuntu虚拟机ip设置
- ubuntu ip静态设置
- Ubuntu的ip设置
- Ubuntu设置静态IP
- Ubuntu的ip设置
- Ubuntu设置固定IP
- ubuntu 设置静态IP
- ubuntu设置ip地址
- ubuntu设置固定IP
- Ubuntu IP 相关设置
- 黑马程序员_七 【异常】【包】【权限修饰符】
- Java 网站
- rvm安装
- 详解在IOS后台执行
- parse,tryparse,Convert.ToInt32 区别
- ubuntu ip设置
- Html5实现iPhone开机界面
- 知乎架构
- androdi组件之Intent
- Opencv Python版cv2读取视频显示
- 数据库复习3
- 基于matlab的数字陷波器设计
- android组件之Activity
- 数据仓库建模基本方法