LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-03-2005, 02:25 AM   #1
learnfast
Member
 
Registered: Mar 2005
Location: berlin
Distribution: Redhat 9, Fedora 3
Posts: 70

Rep: Reputation: 15
can only change network with GUI, not CLI


Why is it that when I say

ifconfig eth0 10.10.0.3 netmask 255.255.0.0
/etc/init.d/network restart

it doesn't connect to the network (can't successfully ping other machines) but (in redhat) when I make the same changes with the GUI "network device control" it then connects to the network.

What else do I have to do beside the two above commands so I am not dependent on the GUI?
 
Old 05-03-2005, 03:14 AM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 57
The network init script most likely reads its settings from a file. Use ifconfig eth0 up instead of running the init script.


Håkan
 
Old 05-03-2005, 06:30 AM   #3
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Stop the network with the command: /etc/rc.d/init.d/network stop or
service network stop
Then use the -a option in ifconfig
For example: /sbin/ifconfig -a eth0 192.168.1.2 netmask 255.255.255.0
Verify the settings with /sbin/ifconfig eth0
Add the default gatway: /sbin/route add default gw 192.168.1.1
Verify the gateway setting: /sbin/route.
The line beginning with default should have your gateway under the gateway column.

You can edit / check the settings in the files
Code:
/etc/sysconfig/network-scripts/ifcfg-eth0

	DEVICE=eth0
	USERCTL=no
	ONBOOT=yes
	BOOTPROTO=none
	BROADCAST=192.168.1.255
	NETWORK=192.168.1.0
	NETMASK=255.255.255.0
	IPADDR=192.168.1.2

and  /etc/sysconfig/network.

	NETWORKING=yes
	HOSTNAME=comp1.mydomain.com
	FORWARD_IPV4=yes
	GATEWAYDEV=
	      GATEWAY=192.168.1.1
Don't forget to restart the network with the command: /etc/rc.d/init.d/network start or
service network start
 
  


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
boot CLI vs GUI weazy Linux - Software 2 08-04-2006 09:15 PM
Bash script - how to tell if in GUI or CLI? dive Programming 2 11-19-2005 02:12 AM
Suse 8.2 Boots to CLI not to GUI porkchopexpress Linux - Newbie 5 06-22-2005 08:27 AM
changing gui from cli twistedrhymes Linux - Newbie 3 06-14-2005 02:44 AM
How do I change my monitor via cli? TheBelush Linux - Newbie 2 03-29-2005 11:07 PM


All times are GMT -5. The time now is 10:49 PM.

Main Menu
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