• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Linux newbie question regarding Ubuntu 7.04 Feisty Fawn

Nocturnal

Lifer
http://www.howtoforge.com/perfect_setup_ubuntu704_p3

I'm following the above guide.

I'm at the section where I'm trying to change my network settings from DHCP to static. I can get to the /etc/network/interfaces but once I'm there, I have the text about loopback and primary network but below all of that there are several "~" like this:

~
~
~
~

Now the guide doesn't tell me how to enter the information in. It also already shows the information as being:

address
netmask
network
broadcast
gateway

Are those already supposed to be there or am I supposed to type it in? If it's the latter, how do I go about doing that? I attempted numerous times to hit the enter key in hopes I could go to a new line but was unsuccessful.

Hopefully someone here can help out a newbie to Linux. Thanks in advance.
 
Alright I'm worse off than I was.

I can somewhat edit and type in those settings.

However, what do you type to I guess save your configuration file?

I tried immediately typing something like:

/etc/init.d/networking restart

But nothing happens and or it says pattern not recognized etc.

HELP
 
I honestly don't know how to get to that portion.

I finally figured it out that I need to use "vi" commands. I was able to finally get the settings right to where I could ssh into the box. The only thing now is that when I use the apt-get command, it goes through as though it's trying to update but it comes back with could not resolve the http://us.ubuntu etc. etc.

Any ideas?
 
Originally posted by: Shawn
You are not connected properly to the internet.

Maybe maybe not. Don't jump to conclusions, it could be something else.



If your not familar with 'vi' then don't bother using it. It's for advanced Linux users and not people who aren't already familar with 'vi'.

Vi is a throwback to the ancient ancient days of Unix. It's safe to ignore it at this point. If your interested in learning it then one of Ubuntu's packages will have a program called 'vimtutor'. Maybe with vim-common package, I am not sure about ubuntu.

But what you'd like to use for text editing in the beginning is nano.

Nano is much easier to use. Use it by going:
> nano text-file.txt

And you'll notice at the bottom there are various ^C or ^X and such keys. The ^ in this program means 'ctrl' key. So those are combos like ctrl-C or ctrl-X.


This is different between things like Fedora vs Ubuntu.. But Ubuntu and Debian have the same configuration files.

For doing a static configuration you need to check several files:

/etc/network/interfaces -- stores the configuration for network interfaces

/etc/resolv.conf -- stores the DNS server information.

/etc/hosts -- hostname information.

The 2 important ones are the interfaces and the resolve.conf.


The person's example is:
auto eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1

for the Eth0 network interface.
that is pretty good.

All you need is this though:

iface eth0 inet static
address 192.168.0.20
netmask 255.255.255.0
gateway 192.168.0.254


The network address and the broadcast address can be both calculated very easily by the netmask and address. So you can delete the other entries. The address, netmask, and gateway are all required entries.

You can learn more about the interfaces files by going 'man interfaces'. Also they have a couple examples.

Note that if your using wireless connections then things get much more complex.

AFter editing the configuration file then the commands to take down and bring up the interfaces are:

sudo ifdown eth0
sudo ifup eth0

Note that some computers have more then one eth# interface. If you still have problems go:
sudo ifconfig -a |less

And see if you have multiple eth0 interfaces. Sometimes firewire ports will show up as network interfaces since you can do limited networking with them.


The second important file is /etc/resolv.conf

This file is for DNS configuration.

It's syntax goes like this:

search domain.com
nameserver 192.168.0.1
nameserver 192.168.0.2


The 'search' line is not very important for home users. It's used for networks were you have real domain names. But otherwise it doesn't realy matter

The nameservers are the ip addresses for your DNS servers. This is very important. Also you can have multiple DNS servers entered there. The computer will try them in the order of they are listed.




Howto troubleshoot network issues:

Lets assume that your network interface is eth0 and that the configuration is:
address 192.168.0.10
netmask 255.255.255.0
gateway 192.168.0.254

and then:
nameserver 192.168.0.1

Substitute your own correct addresses.

Also with the ping command... If you run it it will run forever. After a while you can hit the ctrl-c button combo to kill the ping. This is normal. Let it give you at least 10 good pings. Sometimes network problems.

first, basic networking test. Steps that you have to do and descriptions of the problem is if they fail:


_make_sure_you_run_these_steps_in_order_. If you skip around it will make it harder to figure out what is going on.




1: basic network test. If this fails you have issues.
> ping 127.0.0.1

If that fails then try:
> ifup lo

and try again. Many programs will not function properly without this working, even if they aren't accessing a network.



2: ping your own ip address
> ping 192.168.0.10

If that fails then your network interface is not up or is not configured correctly. Try:
> sudo ifdown eth0
> sudo ifup eth0

And try it again. If it fails check out your /etc/network/interfaces configuration file and run:
> sudo ifconfig eth0

to see the actual current configuration. Could be driver issues.




3. Ping gateway.
> ping 192.168.0.254


If this fails you need to check your wires. Could be the switch is bad or turned off or disconnected. Could be the wire is bad. Could be you have the wire plugged into the wrong port.



4. ping DNS server.
> ping 192.168.0.1

If this fails then your DNS server could be down. Check to make sure that it's properly configured and you ahve the correct IP address.

Also if the DNS server is not on the same network as you (like a DNS server provided by the ISP that is on the internet) then you routing information could be misconfigured. See the descryption after the following command to see how to check for that.




5. ping internet ip address. This is one of google's addresses:
64.233.187.99
Other ones to try are:
216.109.112.135
83.138.189.100

Keep in mind that some servers have ping disabled. But those addresses should be fine. The command is, obviously:

> ping 64.233.187.99



If that fails, and other addresses fail, then your gateway is probably not setup correctly. Make sure you can still ping your gateway.
> ping 192.168.0.254

Check to see if routing information is still setup correctly:
> sudo route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 192.168.0.254 0.0.0.0 UG 0 0 0 eth0


If it is incorrect then check your /etc/network/interfaces file to make sure that is correct and run:
> sudo ifdown eth0
> sudo ifup eth0

Then re-run
> sudo route -n

And it should be correct.


If you still can't ping the external address then maybe your internet connection is down. Double check that.




6. Ping a internet server using Domain name:
> ping www.google.com

It may take up to a few seconds to fail. Just wait until it comes back with a error. Sometimes that error can be very usefull in determining the problem.
If this doesn't work then your DNS server is not working correctly. Check it's configuration or use a different DNS server and see if the other one works better.


If all those commands work then your network should be fully functional and correctly configured.



Hope that helps.
 
Thanks. I'm going to try that later tonight. I think I jacked up the installation so thankfully it won't take that long to re-install it again.

As far as editing the /etc/network/interfaces file will I be doing this:

nano /etc/network/interfaces.txt

Or is the interfaces a .conf file?
 
Originally posted by: Nocturnal
Thanks. I'm going to try that later tonight. I think I jacked up the installation so thankfully it won't take that long to re-install it again.

As far as editing the /etc/network/interfaces file will I be doing this:

nano /etc/network/interfaces.txt

Or is the interfaces a .conf file?

No extension.

sudo nano /etc/network/interfaces
 
Originally posted by: Nocturnal
Thanks guys, NANO is wonders over VI. I guess down the road I can figure out VI. Why is VI so hard to use?

Vi is old school. It was originally developed when people used 800 baud connections to mainframes and such things. No arrow keys or anything like that.

Since then it's just kinda of evolved. The most sophisticated 'vi' isn't the original Vi, it's called VIM for Vi IMproved.

The thing is is that text editing is one of those things that seems easy, but it isn't. When you get multiple programming languages, multiple syntaxes, dealing with programmers and system admin tasks.. t's one of the more complex things that you can do with a computer. And Vi/Vim is one of the best. It's very fast, very effective. Lots of tricks and things that will improve performance and accuracy. But it's not designed to be used with a mouse or arrow keys or anything like that. Everything is pure qwertyp-based commands and keyboard combos.

But for most people it's probably overkill. For casual/normal editing or desktop use nano is probably more then adiquate for most people.

If your curious about learning it you can run the 'vimtutor' program that is aviable in the vim-common package. (of course you'll need vim installed).

just run it like:
> vimtutor

And it will guide you through learning the basics you need to know for text editing with this program.

The rival to Vim is Emacs, which is completely different. Both are pretty bizzare compared to what you see in Windows-land.
 
Back
Top