【已解决】可以ping通无法通过浏览器浏览该网站

来源:互联网 发布:狗语翻译器软件 编辑:程序博客网 时间:2024/05/29 09:47

原文地址:http://stackoverflow.com/questions/21432620/how-to-setup-static-ip-in-fedora-19


First find out your interface using ifconfig

Edit the config file for that interfaceusing 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.

NM_CONTROLLED="yes"BOOTPROTO=staticDEVICE=eth1ONBOOT=yesIPADDR=192.168.8.248NETMASK=255.255.255.0BROADCAST=192.168.8.255NETWORK=192.168.8.0GATEWAY=192.168.8.1TYPE=EthernetPEERDNS=no

Save the file with ESC, then

:w !sudo tee % > /dev/null

Restart your network via

/etc/init.d/network restart

Also add your DNS servers

vi /etc/resolv.confnameserver your_Router_ipnameserver 8.8.8.8 # Google's DNS Server

You are ready to browse!


IF YOU CANNOT BROWSE STILL AFTER TRYING THE METHOD MENTIONED ABOVE...LOOK AT THE BELOW SOLUTION!!!!


Since I'm using Redhat 6.6, I still cannot browse via my own browser Firefox. Then I searched some more materials.

Most comments are related to the Firewall. Then I switch to the firewall side. Due to I have not a lot of knowledge about the firewall. I decided to use the GUI.

Computer->Control Center->Firewall. I checked the service WWW/HTTP 80 ports are unchecked. Then I checked this option. and then input the destination IP address into the firefox browser address bar again, Whooray!!! It does work!


SO HAPPY!!!!





0 0