View previous topic :: View next topic |
Author |
Message |
tobasfxp n00b
Joined: 02 Jun 2004 Posts: 23
|
Posted: Thu Jun 10, 2004 8:40 am Post subject: Need help recompiling kernel ( 4 activating iptables ) |
|
|
Hi
i need some help with recompiling my kernel
i have installed the gentoo-r1 2.6.5 kernel
and now i want 2 share my internet with the following commands :
/bin/echo "1" > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/sbin/iptables -A FORWARD -p tcp --dport 80 -j ACCEPT
/sbin/iptables -A FORWARD -p tcp --dport 443 -j ACCEPT
but this is what i get :
> /bin/echo "1" > /proc/sys/net/ipv4/ip_forward
> /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
FATAL: Module ip_tables not found.
iptables v1.2.9: can't initialize iptables table `nat': iptables who? (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
so i need to upgrade my kernel because iptables is fresh
so this is my question:
how can i ( safely ) access my kernel and activate ip forwarding.
( my system is running very smooth now and i dont want to screw things up )
Tobas |
|
Back to top |
|
|
hardcore l33t
Joined: 01 Nov 2003 Posts: 626 Location: MSU, MI
|
Posted: Thu Jun 10, 2004 10:10 am Post subject: |
|
|
did you ? |
|
Back to top |
|
|
tobasfxp n00b
Joined: 02 Jun 2004 Posts: 23
|
Posted: Thu Jun 10, 2004 10:22 am Post subject: |
|
|
Yes
Code: | > modprobe iptables
FATAL: Module iptables not found. |
Tobas |
|
Back to top |
|
|
hardcore l33t
Joined: 01 Nov 2003 Posts: 626 Location: MSU, MI
|
Posted: Thu Jun 10, 2004 10:25 am Post subject: |
|
|
Next question is, when you compiled/configured your kernel, did you add iptables support, and did you select module or built in? |
|
Back to top |
|
|
tobasfxp n00b
Joined: 02 Jun 2004 Posts: 23
|
Posted: Thu Jun 10, 2004 10:31 am Post subject: |
|
|
No thats my question .
i compiled my kernel with genkernel so i didnt select the options manual
so now i want to add iptables support in my kernel the safest way
Tobas |
|
Back to top |
|
|
hardcore l33t
Joined: 01 Nov 2003 Posts: 626 Location: MSU, MI
|
Posted: Thu Jun 10, 2004 5:58 pm Post subject: |
|
|
Oh ok, well you're going to have to compile your own kernel for iptables support. If you do decide to get iptables working, I can guide you through the process, just let me know. |
|
Back to top |
|
|
tobasfxp n00b
Joined: 02 Jun 2004 Posts: 23
|
Posted: Thu Jun 10, 2004 6:53 pm Post subject: |
|
|
yes i want to recompile just dont know the commands ( for sure )
so if u can help me with that, , im happy
Tobas |
|
Back to top |
|
|
tobasfxp n00b
Joined: 02 Jun 2004 Posts: 23
|
Posted: Thu Jun 10, 2004 8:33 pm Post subject: |
|
|
ok now i done it , i found a little tutorial to recompile my kernel everything went fine but when i copied the new config to my boot partition i screwed up my system
i can start up grub does his job but then
* calculate module dependencies...
* FAILED to calculate dependencies
blabla......
blabla......
* Caching service dependencies......
and then my system locked up
and cant get any further
can i get access 2 my hd and recompile my kernel again ???
Tobas |
|
Back to top |
|
|
hardcore l33t
Joined: 01 Nov 2003 Posts: 626 Location: MSU, MI
|
Posted: Thu Jun 10, 2004 8:50 pm Post subject: |
|
|
ok, well basically here's what I do to recompile a 2.6 series kernel.
as root...
Code: |
cd /usr/src
ls -l (make sure the sym. link points to your kernel, don't worry too much about this)
cd /usr/src/linux
make menuconfig
|
*for iptables*
Code: |
Device Drivers --> Networking Support ---> Networking Options ---> Network Packet Filtering ---> IP: Netfilter Configuration --> *select all as <M>*
|
then exit and save your config,
Code: | make && make modules_install
mount /boot
mv /usr/src/linux/arch/i386/boot/bzImage /boot/bzImage
edit /boot/grub/grub.conf if necessary |
|
|
Back to top |
|
|
hardcore l33t
Joined: 01 Nov 2003 Posts: 626 Location: MSU, MI
|
Posted: Thu Jun 10, 2004 8:52 pm Post subject: |
|
|
tobasfxp wrote: | ok now i done it , i found a little tutorial to recompile my kernel everything went fine but when i copied the new config to my boot partition i screwed up my system
i can start up grub does his job but then
* calculate module dependencies...
* FAILED to calculate dependencies
blabla......
blabla......
* Caching service dependencies......
and then my system locked up
and cant get any further
can i get access 2 my hd and recompile my kernel again ???
Tobas |
so you recompiled your kernel, and moved it to /boot? and when you edited your .config, did you select other things than iptables support? |
|
Back to top |
|
|
tobasfxp n00b
Joined: 02 Jun 2004 Posts: 23
|
Posted: Fri Jun 11, 2004 4:47 am Post subject: |
|
|
i did exacly what you say now but i cant get into my linux now
grub works but thats all
can i get into my system using the live cd ???
Tobas |
|
Back to top |
|
|
hardcore l33t
Joined: 01 Nov 2003 Posts: 626 Location: MSU, MI
|
Posted: Fri Jun 11, 2004 4:59 am Post subject: |
|
|
Yes, you can get into your system with the live cd. |
|
Back to top |
|
|
splooge l33t
Joined: 30 Aug 2002 Posts: 636
|
Posted: Fri Jun 11, 2004 5:01 am Post subject: |
|
|
yep.
boot to live cd
mount /dev/hda3 /mnt/gentoo
mount /dev/hda1 /mnt/gentoo/boot
chroot /mnt/gentoo /bin/bash
env-update
source /etc/profile _________________ http://get.a.clue.de |
|
Back to top |
|
|
tobasfxp n00b
Joined: 02 Jun 2004 Posts: 23
|
Posted: Fri Jun 11, 2004 5:27 am Post subject: |
|
|
ok before i do anything
i did the compile an make and modules_install
copied it to boot ( first mounted boot )
but i didnt change grub
grub is pointing to kernel-2.6.5-gentoo-r1
is this correct or must i change something
Tobas |
|
Back to top |
|
|
hardcore l33t
Joined: 01 Nov 2003 Posts: 626 Location: MSU, MI
|
Posted: Fri Jun 11, 2004 5:31 am Post subject: |
|
|
seems like you should be set |
|
Back to top |
|
|
tobasfxp n00b
Joined: 02 Jun 2004 Posts: 23
|
Posted: Fri Jun 11, 2004 7:11 am Post subject: |
|
|
ok so now i do a new recompile of my kernel ( with the livecd option )
and then i hope it should be ok
Tobas |
|
Back to top |
|
|
tobasfxp n00b
Joined: 02 Jun 2004 Posts: 23
|
Posted: Fri Jun 11, 2004 2:08 pm Post subject: |
|
|
Code: |
cd /usr/src
ls -l
linux -> /usr/src/linux-2.6.5-gentoo-r1
cd /usr/src/linux
make menuconfig
Device Drivers --> Networking Support ---> Networking Options ---> Network Packet Filtering ---> IP: Netfilter Configuration --> *selected all as <M>*
saved
make
make modules_install
mount /boot
mv /usr/src/linux/arch/i386/boot/bzImage /boot/bzImage
reboot
|
and then........
Code: |
*remounting root filesystem read/write...
*setting hostname to tuxbox...
*calculate module dependencies...
*FAILED to calculate dependencies
*using /etc/modules.autoload.d/kernel-2.6 as config:
*loading module via-rhine...
*loading module nvidia...
*loading module emu10k1...
*autoload 3 module(s)
*checking all filesystems...
/dev/hda1: clean, 34/7936 files, 8081/31720 blocks
*loading local filesystems...
*mounting USB device filesystem (usbfs)...
*activating ( possibly ) more swap...
*caching service dependencies
|
and then nothing, the blinking cursor is frozen and nothing happends
but when i change my grub.conf in :
replacing
Code: |
kernel-gentoo.2.6.5-gentoo-r1
|
with
i can login only i have 2 reinstall my graphic-drivers
Tobas |
|
Back to top |
|
|
hardcore l33t
Joined: 01 Nov 2003 Posts: 626 Location: MSU, MI
|
Posted: Fri Jun 11, 2004 3:48 pm Post subject: |
|
|
tobasfxp wrote: |
but when i change my grub.conf in :
replacing
Code: |
kernel-gentoo.2.6.5-gentoo-r1
|
with
i can login only i have 2 reinstall my graphic-drivers
Tobas |
so you mean you replaced kernel-bla-bla with bzImage in a line like this?
Code: |
kernel (hd0,0)/boot/bzImage root=/dev/hda3 |
The reinstall of your graphics drives is normal when you recompile your kernel. Also as root try a modprobe iptables and see if things have worked out. |
|
Back to top |
|
|
tobasfxp n00b
Joined: 02 Jun 2004 Posts: 23
|
Posted: Fri Jun 11, 2004 10:06 pm Post subject: |
|
|
ok im in and iptables works
Tobas |
|
Back to top |
|
|
tobasfxp n00b
Joined: 02 Jun 2004 Posts: 23
|
Posted: Fri Jun 11, 2004 10:14 pm Post subject: |
|
|
i only have 1 more question
ok internet sharing is almost ok now
on my client pc i got 2 programs that work that is flashfxp ( ftp downloader ) and steam ( game tool )
but my internet explorer and msn doesnt work.
i think i have to specify my dns server but i dont know what the adress is, is there a file in my gentoo box ( server ) that tells me or is there an other option.
Tobas |
|
Back to top |
|
|
hardcore l33t
Joined: 01 Nov 2003 Posts: 626 Location: MSU, MI
|
Posted: Sat Jun 12, 2004 6:22 pm Post subject: |
|
|
You might want to post this as a new topic in the networking section, you'll get some help there. |
|
Back to top |
|
|
megalomani Tux's lil' helper
Joined: 08 Jun 2004 Posts: 77
|
Posted: Sat Jun 12, 2004 6:44 pm Post subject: |
|
|
look in /etc/resolv.conf
nameserver |
|
Back to top |
|
|
tobasfxp n00b
Joined: 02 Jun 2004 Posts: 23
|
Posted: Sat Jun 12, 2004 11:11 pm Post subject: |
|
|
thx everything works now m88
Tobas |
|
Back to top |
|
|
|