LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 01-27-2010, 12:08 PM   #1
slgonzalezr
LQ Newbie
 
Registered: Jan 2010
Posts: 7

Rep: Reputation: 0
Unhappy I set an static ipaddress on network-scripts but dinamic ip shows on ifconfig


Hi!

I recently installed fedora 12 in my server where I had a page published in my local net by tomcat, and I was looking on the Internet how to set up an static ip address and this is what I did

on /etc/sysconfig/network-scripts/ifcfg-eth0

# Broadcom Corporation NetXtreme BCM5751 Gigabit Ethernet PCI Express
#
# File: ifcfg-eth0
#
DEVICE=eth0
IPADDR=10.17.148.26
NETMASK=255.255.255.0
BOOTPROTO=static
ONBOOT=yes
#
# The following settings are optional
#
BROADCAST=10.17.148.255
NETWORK=10.17.148.0

and there is another one on

/etc/sysconfig/networking/devices they have the same content

I put this on the command line

ifdown eth0
ifup eth0

then I can access via ssh by two addresses the one I got from dhcp (10.17.148.223) and the static one (10.17.148.26)

I put ifconfig and and 10.17.148.223 appear on eth0

I restart my server and I just can access from 10.17.148.223

I have to put
ifdown eth0
ifup eth0

Again...to access by my static ip, y can access my page by its dns on my server, but I cant access from other computer...so, I guess when my static adress appears on ifconfig I would be able to access my page from other computer...

how can I do this? thanks
 
Old 01-27-2010, 01:21 PM   #2
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
After "ifup eth0", please type: ifconfig eth0, and check your self, which IP interface has.
 
Old 01-27-2010, 01:31 PM   #3
slgonzalezr
LQ Newbie
 
Registered: Jan 2010
Posts: 7

Original Poster
Rep: Reputation: 0
eth0 Link encap:Ethernet HWaddr 00:12:3F:77:11:12
inet addr:10.17.148.223 Bcast:10.17.148.255 Mask:255.255.255.0
inet6 addr: fe80::212:3fff:fe77:1112/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:628 errors:0 dropped:0 overruns:0 frame:0
TX packets:267 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:76183 (74.3 KiB) TX bytes:47170 (46.0 KiB)
Interrupt:17

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:240 (240.0 b) TX bytes:240 (240.0 b)

=(

I tried also #ifconfig eth0 10.17.148.26 netmask 255.255.255.0 broadcast 10.17.148.255 gateway 10.17.148.1, but I cant seem to have access to intenet
 
Old 01-27-2010, 01:41 PM   #4
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
You want to say that after ifconfig eth0 10.17.148.26, your IP won't change?
 
Old 01-27-2010, 01:56 PM   #5
slgonzalezr
LQ Newbie
 
Registered: Jan 2010
Posts: 7

Original Poster
Rep: Reputation: 0
My ip chages...sorry...I wasnt on the server I was remotely connected trough ssh and with ifconfig it changes....it just that I dont have access to internet....indeed now I have two options on the icon of link just aside of the clock on the desktop....how do I get access to the intenet? thanks
 
Old 01-27-2010, 01:59 PM   #6
slgonzalezr
LQ Newbie
 
Registered: Jan 2010
Posts: 7

Original Poster
Rep: Reputation: 0
look...
$ ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:12:3F:77:11:12
inet addr:10.17.148.223 Bcast:10.17.148.255 Mask:255.255.255.0
inet6 addr: fe80::212:3fff:fe77:1112/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2525 errors:0 dropped:0 overruns:0 frame:0
TX packets:139 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:287238 (280.5 KiB) TX bytes:22128 (21.6 KiB)
Interrupt:17

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:480 (480.0 b) TX bytes:480 (480.0 b)

I change my option on the network icon and this is the result but no Internet access
ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:12:3F:77:11:12
inet addr:10.17.148.26 Bcast:10.17.148.255 Mask:255.255.255.0
inet6 addr: fe80::212:3fff:fe77:1112/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2735 errors:0 dropped:0 overruns:0 frame:0
TX packets:320 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:357854 (349.4 KiB) TX bytes:45638 (44.5 KiB)
Interrupt:17

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:960 (960.0 b) TX bytes:960 (960.0 b)
 
Old 01-27-2010, 02:16 PM   #7
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
To answer this question, I at least, have to know network configuration, GW - ?
 
Old 01-27-2010, 03:37 PM   #8
slgonzalezr
LQ Newbie
 
Registered: Jan 2010
Posts: 7

Original Poster
Rep: Reputation: 0
I fixed it...I made it by the GUI and it was because it didnt had de DNS server set....thanks!
 
  


Reply

Tags
ip, static


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
Static IP works from ifconfig but not /etc/network/interfaces neilneil2000 Linux - Networking 4 06-03-2008 03:44 PM
static routes and ifconfig yiux Linux - Networking 4 06-11-2007 07:24 PM
IFConfig and static IP Buto Slackware 4 10-21-2004 04:47 PM
FC2 Overriding static if in favor of dhcp system set for static pkraus109 Linux - Networking 8 09-21-2004 12:13 PM
Setting up static IP using ifconfig firefly2442 Linux - Networking 6 07-19-2004 10:57 AM


All times are GMT -5. The time now is 08:13 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration