LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   static ip on F10 box (https://www.linuxquestions.org/questions/fedora-35/static-ip-on-f10-box-686523/)

andy1974 11-26-2008 09:53 PM

static ip on F10 box
 
hello all i am testing F10 and having a issue with setting up the static ip on the box.


ip 192.168.1.50
subnet mask 255.255.255.0
default gateway 192.168.1.1

when i try to save the settings the subnet mask changes to 192.168.1.1
therefor not making a connection.


anyone else having a issue?

hans21 11-27-2008 09:56 AM

Have you stopped the NetworkManager service?

Personally, I've never liked Network Manager, though, someone told me once that Network Manager is very useful for laptops and handling wireless network connections.

Since I won't be installing F10 for another few days, I don't know how helpful will I be. Letting Network manager set up network in anaconda and throughout the installation process makes me a bit sceptical.

nbcohen 11-27-2008 11:07 AM

I have installed F10 from both the live CD and the DVD. In both cases, I was unable to set up the static IP information using system-config-network - it simply would not save the file.
I manually edited the ifcfg-eth0 file in sysconfig/networking...

But I still had to stop the NetworkManager (remove it from /etc/init.d) in order to get the network to start (you have to enable the /etc/init.d/network function too).

I have installed KDE but not Gnome - maybe you need Gnome to run NetworkManger??
But doing the network setup manually did work...

Hope that helps,

nbc

andy1974 11-27-2008 12:51 PM

Yea i dont like the NetworkManager at all . i did stop it. i will manually edit the config and see how it goes but it looks like the system-config-network in gui is buggy. can you help me out ? which file do i edit the one in the default folder? or the the devices folder?? also what should the config format look like for a static ip?

hans21 11-27-2008 02:50 PM

Ok, now, this is the content of my /etc/sysconfig/network-scripts/ifcfg-eth0 file which defines network parameters:

DEVICE=eth0
BOOTPROTO=none
BROADCAST=192.168.1.255
HWADDR=00:1a:92:b0:4f:10
IPADDR=192.168.1.2
IPV6INIT=no
IPV6_AUTOCONF=yes
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes
NM_CONTROLLED=no
TYPE=Ethernet
USERCTL=no
PEERDNS=yes
GATEWAY=192.168.1.1

DNS2=82.117.194.3
SEARCH=sbb.rs
DNS1=82.117.194.2

This is the static configuration which I use on my system. Relevant lines for your case would be and would look something like:

BOOTPROTO=none (or static, just not "dhcp")
BROADCAST=192.168.1.255
IPADDR=192.168.1.50
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes
NM_CONTROLLED=no
GATEWAY=192.168.1.1

Now go ahead, backup your /etc/sysconfig/network-scripts/ifcfg-eth0 and then alter it to your needs. Also, you'll probably need to add some lines to /etc/resolv.conf (i.e. addresses of your DNS servers)

My /etc/resolv.conf contains:

search sbb.rs

nameserver 82.117.194.2
nameserver 82.117.194.3

(of course, these IP addresses should be replaced with addresses of your DNS servers)

Oh, yea, you'll have to becom priviledged user to do this. Also, make sure you deactivate Network Manager before you proceed by typing:

chkconfig NetworkManager off - this prevents it from starting at boot time

and make sure you do a

service NetworkManger stop - in the current session to stop currently running network manager on your system

then you do

service network restart

and it should work.



Best Regards

PreacherBill 11-27-2008 09:56 PM

I had this same problem. Here's what I did using Gnome as the desktop:

1. I allowed the machine to boot using dhcp to confirm that everything on the network was properly working (it was).

2. Went in to system-config-network via the system->administration->network menu item, giving the root password when asked.

3. Switched from "automatically obtain ip address..." to "statically set ip address..." and set the appropriate values in each field.

4. Made sure that "activate device when computer starts" was checked and that "controlled by network manager" was not checked.

5. Saved everything, exited system-config-network, opened a terminal window, became root, and shut down network managed (service NetworkManaged stop).

6. Opened up /etc/sysconfig/network-scripts/ifcfg-eth0 (immediately saving a backup copy), corrected the NETMASK value in the file, and added BROADCAST and DNS1 settings and their values (based on the information I have, I assume that these last two settings need to be there. I didn't try it without them). Saved the file and exited the editor.

7. Made sure network manager wouldn't srtart on boot (chkconfig NetworkManager off), exited everything, and rebooted the system.

When the system rebooted, I had to go back into system-config-network and tell it to activate eth0 - even though the config file said it should be active on boot, it didn't activate the first time. I rebooted again, and the network came up just fine.

It seems fairly obvious here that someone writing the code put the wrong variable in a certain spot, and no one caught it. I know it's easy to do - I've done it. But this is still such an obvious thing that it should have been caught. I can't believe that no one in all the testing didn't try to set a static ip address. But at least it's easily fixable!

Anyway - it worked for me.

Bill

PreacherBill 11-27-2008 10:10 PM

Well...I guess I should have paid attention to the post in front of my last one, since I pretty much repeated what had already bee said. Just put it doen to senility :tisk:

On another note, i just checked another machine running fedora 9 using network manager, and everything is working as it should. So this was working in 9, and now seems to be broken in 10!

I guess that's just the way things go.

Again, sorry about duplicating the previous post

Bill

andy1974 11-28-2008 08:24 AM

yea , somewhere along the line there was somthing changed and missed.

PreacherBill 11-28-2008 05:18 PM

Well, I obviously spoke too soon. I had to reboot the machine here a few minutes ago, and eth0 interface did not come up on its own. I once again had to manually start it. This is irritating at best since I have several nfs shares mounted from other machines on this one that mount at boot time. It's not a killer, but it is frustrating, particularly when this worked fine in fedora 9.

So if anyone has any other suggestions, please speak up!

Bill

nbcohen 11-28-2008 08:49 PM

Same thing happened to me. I installed Webmin and used that to mark the 'network' command as being started on boot and that seems to have taken care of the problem...

nbc

PreacherBill 11-28-2008 10:30 PM

Quote:

Originally Posted by nbcohen (Post 3358324)
Same thing happened to me. I installed Webmin and used that to mark the 'network' command as being started on boot and that seems to have taken care of the problem...

nbc

OK - I'll give that a try tomorrow and see if it solves the problem.

hans21 11-30-2008 04:26 PM

Hello again,

by now I've installed Fedora 10 and configured my NIC with static IP address. It worked without a glitch. Here is the
/etc/sysconfig/network-scripts/ifcfg-eth0


# Marvell Technology Group Ltd. 88E8001 Gigabit Ethernet Controller
DEVICE=eth0
HWADDR=00:1a:92:b0:4f:10
ONBOOT=yes
BOOTPROTO=none
NETMASK=255.255.255.0
IPADDR=192.168.1.2
NETWORK=192.168.1.0
USERCTL=no
PEERDNS=yes
IPV6INIT=no
NM_CONTROLLED=no
GATEWAY=192.168.1.1
TYPE=Ethernet


One more thing, You are definitely right about graphical network configuration - it sucks. When configuring my NIC with address of 192.168.1.2, subnet 255.255.255.0, and gateway 192.168.1.1, and saving configuration -> subnet field gets assigned with 192.168.1.1 value?!?
Therefore, I resorted to changing the file directly via vim editor and everything went well. Of course, once again, you'll have to edit /etc/resolv.conf too.

Best Regards.

beawolf 01-27-2009 04:19 AM

Autostart of Network
 
If you deactivate NetworkManager you may need the network service automatically start on boot. Just follow these steps (You may need to be root to do these):

1. On terminal, type "ntsysv" without quotes.
2. Highlight "network" by using arrow keys, and press Spacebar to mark it.
3. Press Tab to highlight "Ok", and press Enter to save and exit.

DinoFly 01-27-2009 08:03 PM

Quote:

Originally Posted by hans21 (Post 3359755)
One more thing, You are definitely right about graphical network configuration - it sucks.

Best Regards.

Definetly it sucks but you can use system-config-network-tui wich will give you back plain old network configuration tool.

By the way I think it will not work if you have a NetworkManager managing that device keep in mind follow what PrecherBill sugested (that is how I fixed the same problem), so you should turn that think off, by entring into a NetworkManager and editing a device (eth0) and I don't know for sure but I think the second tick is to enable and disable that feature just read it and you will see it. Than proceed with useful tips from the other guys editing /etc/sysconfig/network-scripts/ifcfg-ethX and restart the network service.

Don't have to reboot the system simply restart the network service with service network restart command.

By the way you wont have this problem if you run Fedora 10 on runlevel 3, at least I am not haveing it on that runlevel.

Quote:

Personally, I've never liked Network Manager, though, someone told me once that Network Manager is very useful for laptops and handling wireless network connections.
It is a life saviour if you use it with laptops and wireles and different network profiles, but only once you get it working right :)


All times are GMT -5. The time now is 12:05 PM.