Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
IPMASQ Howto
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
The_Loserkid
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2003
Posts: 101
Location: Merksem, Belgium

PostPosted: Sun Dec 28, 2003 9:00 pm    Post subject: IPMASQ Howto Reply with quote

hello,
i've consulted a IP Masquerading how-to in order to get my gentoo machine to share it's internet connection to my 2 other computers
the how-to is located here:
http://en.tldp.org/HOWTO/IP-Masquerade-HOWTO/ipmasq-compiling3.1.html

after doing "make modules_install" the how-to says:

Quote:
You will then have move over the kernel binary, update your bootloader (LILO, Grub, etc.), and reboot. If you have questions about kernel compiling, I highly recommend to consult some of the URLs mentioned above in this section.


i don't get the "you will then have move over your kernel binary" thing, can someone plz explain what he's trying to say and what i have got to do ....
and, since i'm still an apprentice at linux i don't really know what to adjust in my grub config file ....

could anyone please help me out with what i have to adjust in the config file and what the "you have move over kernel binary" thing means ?

plz plz plz ? :(
Back to top
View user's profile Send private message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Mon Dec 29, 2003 12:03 am    Post subject: Re: IPMASQ Howto Reply with quote

The_Loserkid wrote:
Quote:
You will then have move over the kernel binary, update your bootloader (LILO, Grub, etc.), and reboot. If you have questions about kernel compiling, I highly recommend to consult some of the URLs mentioned above in this section.

could anyone please help me out with what i have to adjust in the config file and what the "you have move over kernel binary" thing means ?


To "move over the kernel binary":
Code:
# mount /boot
# cp /usr/src/linux/arch/i386/boot/bzImage /boot/bzImage-<new_kernel_version>


To tell you how to modify your /boot/grub/grub.conf, we'll need to see a copy of your existing grub.conf file.
Back to top
View user's profile Send private message
The_Loserkid
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2003
Posts: 101
Location: Merksem, Belgium

PostPosted: Mon Dec 29, 2003 12:12 am    Post subject: Reply with quote

hm k, why do i have to mount /boot first ?
so it'll become:

Code:

# mount /boot
# cp /usr/src/linux/arch/i386/boot/bzImage /boot/bzImage-2.4.23


that correct ?
Back to top
View user's profile Send private message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Mon Dec 29, 2003 12:19 am    Post subject: Reply with quote

The_Loserkid wrote:
hm k, why do i have to mount /boot first ?

Unless if you've changed it yourself, gentoo systems keep /boot unmounted to prevent corruption to /boot should your system crash.

The_Loserkid wrote:
Code:

# mount /boot
# cp /usr/src/linux/arch/i386/boot/bzImage /boot/bzImage-2.4.23


that correct ?

Looks fine. Though if you're using gentoo-sources, you may want to use "bzImage-2.4.23-gentoo". It doesn't really matter, though. You can (pretty much) call the file whatever you want. What's important is that the name you give here needs to match what you put in your grub.conf. (Speaking of which, let's see that grub.conf of yours!)
Back to top
View user's profile Send private message
The_Loserkid
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2003
Posts: 101
Location: Merksem, Belgium

PostPosted: Mon Dec 29, 2003 12:22 am    Post subject: Reply with quote

oké, i've done the mount /boot thing and the cp thing
my grub.conf holds the following:

Code:
default 0
timeout 30
title=Gentoo
root (hd0,0)
kernel (hd0,0)/boot/bzImage root=/dev/hda3


so what do i have to change ?

thx for your help so far :)

i think i have to change
Code:
 kernel (hd0,0)/boot/bzImage-2.4.23


correct ? :p
Back to top
View user's profile Send private message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Mon Dec 29, 2003 12:36 am    Post subject: Reply with quote

The_Loserkid wrote:
Code:
default 0
timeout 30
title=Gentoo
root (hd0,0)
kernel (hd0,0)/boot/bzImage root=/dev/hda3


so what do i have to change ?

Try this:

Code:
default 0
timeout 30

title=Gentoo Linux (2.4.23)
root (hd0,0)
kernel (hd0,0)/boot/bzImage-2.4.23-gentoo root=/dev/hda3

title=Gentoo
root (hd0,0)
kernel (hd0,0)/boot/bzImage root=/dev/hda3


Here's what it means:
"default 0" says that the default option will be the first boot option.
"timeout 30" says to choose the default option after 30s.
"title=Gentoo Linux (2.4.23)" gives the entry you will see in the boot menu.
"root (hd0,0)" specifies the device containing your "root" file system. (For the purposes of booting, your "root" file system is really your /boot partition. This can be a little confusing.)
"kernel (hd0,0)/boot/bzImage-2.4.23-gentoo root=/dev/hda3" tells GRUB where the kernel image can be found, and what options to pass to the kernel.

If you get different output when you run `uname -r' under your two kernels, then you should be able to switch back to the old one if the new one doesn't work.

The_Loserkid wrote:
thx for your help so far :)

You're quite welcome. :)
Back to top
View user's profile Send private message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Mon Dec 29, 2003 12:47 am    Post subject: Reply with quote

The_Loserkid wrote:
i get everything except for the
Quote:
If you get different output when you run `uname -r' under your two kernels, then you should be able to switch back to the old one if the new one doesn't work

The command "uname -r" prints out the "release name" of the kernel you're currently using. If you don't clobber your old kernel image (which you haven't) and the release names of your two kernels differ, then you should be able to boot back into your old kernel.

The reason you need different release names is because your kernel modules are stored in /lib/modules/<release_name>. If your new kernel has the same release name as the old one, then when you do "make modules_install", you're clobbering the kernel modules for your old kernel. This isn't to say that your old kernel won't work anymore. It's just possible that you may have broken something in your old kernel as a result.

The release name is composed of your kernel version number, appended with the "EXTRAVERSION" string in /usr/src/linux/Makefile. By changing the "EXTRAVERSION" string each time you recompile your kernel, you can guarantee a new release name for the new kernel.
Back to top
View user's profile Send private message
The_Loserkid
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2003
Posts: 101
Location: Merksem, Belgium

PostPosted: Mon Dec 29, 2003 12:48 am    Post subject: Reply with quote

hey, weird, i get
Code:
2.4.20-gentoo-r8

both under the new and the old kernel ....
shouldn't the new kernel give me
Code:
2.4.23-gentoo-r8

or something like that ?
Back to top
View user's profile Send private message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Mon Dec 29, 2003 12:50 am    Post subject: Reply with quote

The_Loserkid wrote:
hey, weird, i get
Code:
2.4.20-gentoo-r8

both under the new and the old kernel ....
shouldn't the new kernel give me
Code:
2.4.23-gentoo-r8

or something like that ?

Are you sure you compiled 2.4.23? Check `ls -l /usr/src/linux'.
Back to top
View user's profile Send private message
The_Loserkid
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2003
Posts: 101
Location: Merksem, Belgium

PostPosted: Mon Dec 29, 2003 12:56 am    Post subject: Reply with quote

it contains:
lrwxrwxrwx
1 root
root
and a symbolic link: /usr/src/linux -> linux-2.4.20-gentoo-r8
Back to top
View user's profile Send private message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Mon Dec 29, 2003 1:02 am    Post subject: Reply with quote

The_Loserkid wrote:
it contains:
lrwxrwxrwx
1 root
root
and a symbolic link: /usr/src/linux -> linux-2.4.20-gentoo-r8

Looks like you built 2.4.20. :) Try it out; it'll probably work anyway.

If you want to build 2.4.23:
Code:
# cd /usr/src
# rm linux
# ln -s linux-2.4.23-gentoo-<whatever> linux
# cd linux
[edit Makefile if you want to change EXTRAVERSION]
# make menuconfig
etc...


Always make sure /usr/src/linux points to the version of the kernel you want to compile.... ;)
Back to top
View user's profile Send private message
The_Loserkid
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2003
Posts: 101
Location: Merksem, Belgium

PostPosted: Mon Dec 29, 2003 1:05 am    Post subject: Reply with quote

well, i've obviously not compiled kernel 2.4.23
:/
but i don't know what i've done wrong :s

I think it went wrong in the very beginning
the howto says:
Quote:
For this HOWTO example, create a directory called /usr/src/kernel. Next, "cd" into this directory and download the newest 2.4.x kernel sources into it. Once downloaded, issue the following command (if the file ends in a .tar.gz): tar xvzf linux-2.4.x.tar.gz or (if the file ends in a .tar.bzip2): tar xyvf linux-2.4.x.tar.bz2. Please substitute the "x" in the 2.4.x filename with the Linux 2.4 kernel version you downloaded.

BZ2 Note: Some Linux distributions use the "I" option instead of the "y" option to decompress bzip2 archives.

Once uncompressed, I recommend that you rename the directory from the stock "linux" name to "linux-2.4.x" (replace the "x" with the specific version of your newly installed kernel) for clarity. To do this, run the command "mv linux linux-2.4.x". Next, make sure there is a directory or symbolic link pointing to "/usr/src/kernel/linux" ie. run the command:

check the last alinea, it says that it's going to rename the stock "linux" name to "linux-2.4.23"
but when i uncompress it, it automatically uncompressed to linux-2.4.23 so no linux folder is made .....
so i then thought maybe i'd rename linux-2.4.23 to linux
that wasn't such a good idea i suppose ? :s
Back to top
View user's profile Send private message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Mon Dec 29, 2003 1:05 am    Post subject: Reply with quote

The_Loserkid wrote:
shouldn't the new kernel give me
Code:
2.4.23-gentoo-r8

or something like that ?


BTW, it doesn't look like "gentoo-sources-2.4.23" even exists.... Are you building vanilla-sources or something?
Back to top
View user's profile Send private message
The_Loserkid
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2003
Posts: 101
Location: Merksem, Belgium

PostPosted: Mon Dec 29, 2003 1:07 am    Post subject: Reply with quote

eep ?
i've downloaded linux-2.4.23.tar.gz from ftp.belnet.be
can you specify the
# ln -s linux-2.4.23-gentoo-<whatever> linux
line plz ? :p
Back to top
View user's profile Send private message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Mon Dec 29, 2003 1:10 am    Post subject: Reply with quote

The_Loserkid wrote:
Quote:
For this HOWTO example, create a directory called /usr/src/kernel. Next, "cd" into this directory and download the newest 2.4.x kernel sources into it.

Aha. You didn't need to download the kernel sources yourself. Just do
Code:
# emerge gentoo-sources

or, if you prefer,
Code:
# emerge vanilla-sources


That will download and uncompress the kernel sources in the appropriate location for you. After that, make sure /usr/src/linux points to the right location (a la my previous post), and you'll be all set.
Back to top
View user's profile Send private message
The_Loserkid
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2003
Posts: 101
Location: Merksem, Belgium

PostPosted: Mon Dec 29, 2003 1:10 am    Post subject: Reply with quote

about the
# ln -s linux-2.4.23-gentoo-<whatever> linux
line
my 2.4.23 folder isn't in /usr/src
it's in /usr/src/kernel/
Back to top
View user's profile Send private message
The_Loserkid
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2003
Posts: 101
Location: Merksem, Belgium

PostPosted: Mon Dec 29, 2003 1:11 am    Post subject: Reply with quote

tazmanian wrote:
The_Loserkid wrote:
Quote:
For this HOWTO example, create a directory called /usr/src/kernel. Next, "cd" into this directory and download the newest 2.4.x kernel sources into it.

Aha. You didn't need to download the kernel sources yourself. Just do
Code:
# emerge gentoo-sources

or, if you prefer,
Code:
# emerge vanilla-sources


That will download and uncompress the kernel sources in the appropriate location for you. After that, make sure /usr/src/linux points to the right location (a la my previous post), and you'll be all set.



hmmm let's take this back to the very beginning :)
i've already removed the /usr/src/linux folder like u told me ...
i hope that wasn't a mistake so far ......
so what do i have to do now
i go to /usr/src/kernel and i do
#emerge gentoo-sources
and then what ?

btw, the folder /usr/src/kernel holds 2 files, linux-2.4.23.tar.gz and the map linux (where i extracted linux-2.4.23.tar.gz to) can i delete those ?
Back to top
View user's profile Send private message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Mon Dec 29, 2003 1:21 am    Post subject: Reply with quote

The_Loserkid wrote:
hmmm let's take this back to the very beginning :)

Good idea. ;)

The_Loserkid wrote:
i've already removed the /usr/src/linux folder like u told me ...
i hope that wasn't a mistake so far ......
so what do i have to do now
i do
#emerge gentoo-sources

and then what ?


Here's the run-down:
Code:
# emerge gentoo-sources
# cd /usr/src
# ln -s linux-2.4.22-gentoo-r2 linux
# cd linux
[edit Makefile, change EXTRAVERSION]
# make menuconfig
# make dep && make bzImage modules modules_install
# mount /boot
# cp arch/i386/boot/bzImage /boot/bzImage-2.4.22-gentoo-r2
[edit /boot/grub/grub.conf]
[reboot]


http://www.gentoo.org/doc/en/handbook/handbook.xml?part=1&chap=7 does a much better job of explaining it. :)

The_Loserkid wrote:
(btw, aren't i going to be left with too much "data" like, my bzImage-2.4.23 wich is actually jsut 2.4.20 :p)

Yes. You can remove that if you like.

Anyway, I gotta go offline now. Good luck!
Back to top
View user's profile Send private message
The_Loserkid
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2003
Posts: 101
Location: Merksem, Belgium

PostPosted: Mon Dec 29, 2003 1:23 am    Post subject: Reply with quote

can you hold on for just a small second, what is the EXTRAVERSION thing ?
i can't CTRL+F it in the kernel howto you gave
Back to top
View user's profile Send private message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Mon Dec 29, 2003 1:24 am    Post subject: Reply with quote

The_Loserkid wrote:
can you hold on for just a small second, what is the EXTRAVERSION thing ?
i can't CTRL+F it in the kernel howto you gave

That's something extra that they don't cover. I mentioned it in a previous post. If you don't know what it is, don't worry about it. :)
Back to top
View user's profile Send private message
The_Loserkid
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2003
Posts: 101
Location: Merksem, Belgium

PostPosted: Mon Dec 29, 2003 1:24 am    Post subject: Reply with quote

tazmanian wrote:
The_Loserkid wrote:
can you hold on for just a small second, what is the EXTRAVERSION thing ?
i can't CTRL+F it in the kernel howto you gave

That's something extra that they don't cover. I mentioned it in a previous post. If you don't know what it is, don't worry about it. :)


so it's optional and it's okay if i leave it out ?
Back to top
View user's profile Send private message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Mon Dec 29, 2003 1:25 am    Post subject: Reply with quote

The_Loserkid wrote:
tazmanian wrote:
The_Loserkid wrote:
can you hold on for just a small second, what is the EXTRAVERSION thing ?
i can't CTRL+F it in the kernel howto you gave

That's something extra that they don't cover. I mentioned it in a previous post. If you don't know what it is, don't worry about it. :)


so it's optional and it's okay if i leave it out ?
Yes.
Back to top
View user's profile Send private message
The_Loserkid
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2003
Posts: 101
Location: Merksem, Belgium

PostPosted: Mon Dec 29, 2003 1:25 am    Post subject: Reply with quote

tazmanian wrote:
The_Loserkid wrote:
tazmanian wrote:
The_Loserkid wrote:
can you hold on for just a small second, what is the EXTRAVERSION thing ?
i can't CTRL+F it in the kernel howto you gave

That's something extra that they don't cover. I mentioned it in a previous post. If you don't know what it is, don't worry about it. :)


so it's optional and it's okay if i leave it out ?
Yes.


thx a lot, i'll let you know if everything works
Back to top
View user's profile Send private message
Decibels
Veteran
Veteran


Joined: 16 Aug 2002
Posts: 1630
Location: U.S.A.

PostPosted: Mon Dec 29, 2003 5:19 am    Post subject: Reply with quote

Your title is pretty misleading. :wink:
_________________
Support bacteria – they’re the only culture some people have.”

– Steven Wright
Back to top
View user's profile Send private message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Mon Dec 29, 2003 6:39 am    Post subject: Reply with quote

Decibels wrote:
Your title is pretty misleading. :wink:

heh...indeed it is!

How'd it go, btw?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum