Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-30-2013, 08:36 AM
|
#1
|
Member
Registered: Aug 2012
Posts: 30
Rep: 
|
Centos internet not working with local static ip adress.
My local ip adress changing when centos every restart.
and i want to local static ip.
and changed /etc/sysconfig/network-scripts/ifcfg-eth1
BOOTPROTO=dhcp to BOOTPROTO=static
and i typed IPADDR=XX.XX.XX.XX (example)
now everything ssh apache working but NOT INTERNET CONNECTION.
#nano /etc/sysconfig/network-scripts/ifcfg-eth1
-------------------------------------------------
DEVICE="eth1"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=94:0C:6D:82:90:1C
TYPE=Ethernet
BOOTPROTO=static
NAME="System eth0"
IPADDR=192.168.1.11
NETMASK=255.255.255.0
----------------------------------------------------
I want static local ip but work internet.
PLEASE HELP ME.
Last edited by DeSouffle; 08-30-2013 at 08:38 AM.
|
|
|
08-30-2013, 11:19 AM
|
#2
|
Member
Registered: Jun 2011
Distribution: redhat, CentOS, OpenBSD
Posts: 298
Rep:
|
DeSouffle...
First, change BOOTPROTO=static to BOOTPROTO=none. Your options are none, dhcp, or bootp
Then add the following lines:
NETWORK=192.168.1.0
GATEWAY=192.168.1.1 (assuming .1 is your gateway, if not, put appropriate address here)
DNS= (add address of DNS server here)
|
|
|
08-30-2013, 01:27 PM
|
#3
|
Member
Registered: Aug 2012
Posts: 30
Original Poster
Rep: 
|
Quote:
Originally Posted by netnix99
desouffle...
First, change bootproto=static to bootproto=none. Your options are none, dhcp, or bootp
then add the following lines:
Network=192.168.1.0
gateway=192.168.1.1 (assuming .1 is your gateway, if not, put appropriate address here)
dns= (add address of dns server here)
|
thanks everything problem solved 
|
|
|
08-30-2013, 11:38 PM
|
#4
|
Senior Member
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983
|
Quote:
Originally Posted by netnix99
DeSouffle...
First, change BOOTPROTO=static to BOOTPROTO=none. Your options are none, dhcp, or bootp
Then add the following lines:
NETWORK=192.168.1.0
GATEWAY=192.168.1.1 (assuming .1 is your gateway, if not, put appropriate address here)
DNS= (add address of DNS server here)
|
static is an option for all RH distros and their forks:
Code:
$ cat /etc/sysconfig/network-scripts/ifcfg-eth4
DEVICE="eth4"
TYPE="Ethernet"
NAME="System eth4"
ONBOOT="yes"
#BOOTPROTO="dhcp"
BOOTPROTO="static"
NM_CONTROLLED="no"
IPADDR=192.168.222.222
NETMASK=255.255.255.0
USERCTL="no"
#DEFROUTE=yes
#PEERROUTES=yes
#PEERDNS=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
only reason i leave the dhcp stuff in there is for when i take my server out of my LAN and need to access some other LAN via dhcp. ie: when i goto my linux user group's instal fest.
|
|
|
09-03-2013, 09:14 AM
|
#5
|
Member
Registered: Jun 2011
Distribution: redhat, CentOS, OpenBSD
Posts: 298
Rep:
|
lleb,
I'm sure it still works, but according to Red Hat, for RHEL6 and above, the correct option is "none".
BOOTPROTO=protocol
where protocol is one of the following:
none — No boot-time protocol should be used.
bootp — The BOOTP protocol should be used.
dhcp — The DHCP protocol should be used.
from: https://access.redhat.com/site/docum...nterfaces.html
|
|
|
09-03-2013, 11:11 AM
|
#6
|
Member
Registered: Aug 2012
Posts: 30
Original Poster
Rep: 
|
THANKS EVERYTHINg STILL FINE WORKS 
|
|
|
09-03-2013, 04:58 PM
|
#7
|
Senior Member
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983
|
Quote:
Originally Posted by netnix99
lleb,
I'm sure it still works, but according to Red Hat, for RHEL6 and above, the correct option is "none".
BOOTPROTO=protocol
where protocol is one of the following:
none — No boot-time protocol should be used.
bootp — The BOOTP protocol should be used.
dhcp — The DHCP protocol should be used.
from: https://access.redhat.com/site/docum...nterfaces.html
|
good to know. many thanks. ill make some adjustments to my rig  .
|
|
|
All times are GMT -5. The time now is 01:28 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|