如何在Fedora 19中设置Static Ip

时间:2021-07-25 07:09:21

While using Fedora 19 on VMware player(Harvard CS50x appliance 19) , the guest OS is not able to access the internet even though the host is .

在VMware播放器(Harvard CS50x设备19)上使用Fedora 19时,即使主机是,客户操作系统也无法访问互联网。

How to set static Ip address to access Internet ?

如何设置静态IP地址访问Internet?

1 个解决方案

#1


24  

First find out your interface using ifconfig

首先使用ifconfig查找您的界面

Edit the config file for that interface using your favorite text editor:

使用您喜欢的文本编辑器编辑该接口的配置文件:

vi /etc/sysconfig/network-scripts/ifcfg-eth1 //where eth1 is your interface

You will need to change BOOTPROTO from dhcp to static and add IPADDR, NETMASK, BROADCAST and NETWORK variables.

您需要将BOOTPROTO从dhcp更改为static并添加IPADDR,NETMASK,BROADCAST和NETWORK变量。

NM_CONTROLLED="yes"
BOOTPROTO=static
DEVICE=eth1
ONBOOT=yes
IPADDR=192.168.8.248
NETMASK=255.255.255.0
BROADCAST=192.168.8.255
NETWORK=192.168.8.0
GATEWAY=192.168.8.1
TYPE=Ethernet
PEERDNS=no

Save the file :w !sudo tee % > /dev/null

保存文件:w!sudo tee%> / dev / null

Also add your DNS servers

还要添加DNS服务器

vi /etc/resolv.conf

nameserver your_Router_ip
nameserver 8.8.8.8 # Google's DNS Server

You are ready to browse!

你准备好浏览了!

#1


24  

First find out your interface using ifconfig

首先使用ifconfig查找您的界面

Edit the config file for that interface using your favorite text editor:

使用您喜欢的文本编辑器编辑该接口的配置文件:

vi /etc/sysconfig/network-scripts/ifcfg-eth1 //where eth1 is your interface

You will need to change BOOTPROTO from dhcp to static and add IPADDR, NETMASK, BROADCAST and NETWORK variables.

您需要将BOOTPROTO从dhcp更改为static并添加IPADDR,NETMASK,BROADCAST和NETWORK变量。

NM_CONTROLLED="yes"
BOOTPROTO=static
DEVICE=eth1
ONBOOT=yes
IPADDR=192.168.8.248
NETMASK=255.255.255.0
BROADCAST=192.168.8.255
NETWORK=192.168.8.0
GATEWAY=192.168.8.1
TYPE=Ethernet
PEERDNS=no

Save the file :w !sudo tee % > /dev/null

保存文件:w!sudo tee%> / dev / null

Also add your DNS servers

还要添加DNS服务器

vi /etc/resolv.conf

nameserver your_Router_ip
nameserver 8.8.8.8 # Google's DNS Server

You are ready to browse!

你准备好浏览了!