LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-30-2013, 08:36 AM   #1
DeSouffle
Member
 
Registered: Aug 2012
Posts: 30

Rep: Reputation: Disabled
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.
 
Old 08-30-2013, 11:19 AM   #2
netnix99
Member
 
Registered: Jun 2011
Distribution: redhat, CentOS, OpenBSD
Posts: 298

Rep: Reputation: 99
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)
 
Old 08-30-2013, 01:27 PM   #3
DeSouffle
Member
 
Registered: Aug 2012
Posts: 30

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by netnix99 View Post
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
 
Old 08-30-2013, 11:38 PM   #4
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by netnix99 View Post
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.
 
Old 09-03-2013, 09:14 AM   #5
netnix99
Member
 
Registered: Jun 2011
Distribution: redhat, CentOS, OpenBSD
Posts: 298

Rep: Reputation: 99
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
 
Old 09-03-2013, 11:11 AM   #6
DeSouffle
Member
 
Registered: Aug 2012
Posts: 30

Original Poster
Rep: Reputation: Disabled
THANKS EVERYTHINg STILL FINE WORKS
 
Old 09-03-2013, 04:58 PM   #7
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by netnix99 View Post
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 .
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CentOS 3.5 Enterprise Server -- I need to change my Local Static IP address. kexpert Red Hat 12 11-08-2009 06:33 AM
Setting up a static IP adress with a wlan (RT2501USB Wireless Adapter) Penguino Linux - Wireless Networking 4 04-20-2009 09:39 PM
How to set up static IP/Broadband Router on CentOS to use Internet? linux_related Linux - Networking 23 09-19-2007 02:01 AM
change to static ip adress.. Probably quite easy! :) THOR_Fedora Linux - Networking 6 08-16-2006 08:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration