Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Need help recompiling kernel ( 4 activating iptables )
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
tobasfxp
n00b
n00b


Joined: 02 Jun 2004
Posts: 23

PostPosted: Thu Jun 10, 2004 8:40 am    Post subject: Need help recompiling kernel ( 4 activating iptables ) Reply with quote

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
View user's profile Send private message
hardcore
l33t
l33t


Joined: 01 Nov 2003
Posts: 626
Location: MSU, MI

PostPosted: Thu Jun 10, 2004 10:10 am    Post subject: Reply with quote

did you
Code:
modprobe iptables
?
Back to top
View user's profile Send private message
tobasfxp
n00b
n00b


Joined: 02 Jun 2004
Posts: 23

PostPosted: Thu Jun 10, 2004 10:22 am    Post subject: Reply with quote

Yes :?

Code:
> modprobe iptables
FATAL: Module iptables not found.


Tobas
Back to top
View user's profile Send private message
hardcore
l33t
l33t


Joined: 01 Nov 2003
Posts: 626
Location: MSU, MI

PostPosted: Thu Jun 10, 2004 10:25 am    Post subject: Reply with quote

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
View user's profile Send private message
tobasfxp
n00b
n00b


Joined: 02 Jun 2004
Posts: 23

PostPosted: Thu Jun 10, 2004 10:31 am    Post subject: Reply with quote

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
View user's profile Send private message
hardcore
l33t
l33t


Joined: 01 Nov 2003
Posts: 626
Location: MSU, MI

PostPosted: Thu Jun 10, 2004 5:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
tobasfxp
n00b
n00b


Joined: 02 Jun 2004
Posts: 23

PostPosted: Thu Jun 10, 2004 6:53 pm    Post subject: Reply with quote

yes i want to recompile just dont know the commands ( for sure )

so if u can help me with that, , im happy

Tobas :lol:
Back to top
View user's profile Send private message
tobasfxp
n00b
n00b


Joined: 02 Jun 2004
Posts: 23

PostPosted: Thu Jun 10, 2004 8:33 pm    Post subject: Reply with quote

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 :cry:

* calculate module dependencies...
* FAILED to calculate dependencies

blabla......
blabla......
* Caching service dependencies......

and then my system locked up :cry:

and cant get any further

can i get access 2 my hd and recompile my kernel again ???


Tobas
Back to top
View user's profile Send private message
hardcore
l33t
l33t


Joined: 01 Nov 2003
Posts: 626
Location: MSU, MI

PostPosted: Thu Jun 10, 2004 8:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
hardcore
l33t
l33t


Joined: 01 Nov 2003
Posts: 626
Location: MSU, MI

PostPosted: Thu Jun 10, 2004 8:52 pm    Post subject: Reply with quote

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 :cry:

* calculate module dependencies...
* FAILED to calculate dependencies

blabla......
blabla......
* Caching service dependencies......

and then my system locked up :cry:

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
View user's profile Send private message
tobasfxp
n00b
n00b


Joined: 02 Jun 2004
Posts: 23

PostPosted: Fri Jun 11, 2004 4:47 am    Post subject: Reply with quote

i did exacly what you say now but i cant get into my linux now :cry:

grub works but thats all

can i get into my system using the live cd ???

Tobas
Back to top
View user's profile Send private message
hardcore
l33t
l33t


Joined: 01 Nov 2003
Posts: 626
Location: MSU, MI

PostPosted: Fri Jun 11, 2004 4:59 am    Post subject: Reply with quote

Yes, you can get into your system with the live cd.
Back to top
View user's profile Send private message
splooge
l33t
l33t


Joined: 30 Aug 2002
Posts: 636

PostPosted: Fri Jun 11, 2004 5:01 am    Post subject: Reply with quote

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
View user's profile Send private message
tobasfxp
n00b
n00b


Joined: 02 Jun 2004
Posts: 23

PostPosted: Fri Jun 11, 2004 5:27 am    Post subject: Reply with quote

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
View user's profile Send private message
hardcore
l33t
l33t


Joined: 01 Nov 2003
Posts: 626
Location: MSU, MI

PostPosted: Fri Jun 11, 2004 5:31 am    Post subject: Reply with quote

seems like you should be set
Back to top
View user's profile Send private message
tobasfxp
n00b
n00b


Joined: 02 Jun 2004
Posts: 23

PostPosted: Fri Jun 11, 2004 7:11 am    Post subject: Reply with quote

ok so now i do a new recompile of my kernel ( with the livecd option :roll: )
and then i hope it should be ok


Tobas
Back to top
View user's profile Send private message
tobasfxp
n00b
n00b


Joined: 02 Jun 2004
Posts: 23

PostPosted: Fri Jun 11, 2004 2:08 pm    Post subject: Reply with quote

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
:cry:


but when i change my grub.conf in :

replacing

Code:


kernel-gentoo.2.6.5-gentoo-r1



with

Code:


bzImage



i can login only i have 2 reinstall my graphic-drivers


Tobas
Back to top
View user's profile Send private message
hardcore
l33t
l33t


Joined: 01 Nov 2003
Posts: 626
Location: MSU, MI

PostPosted: Fri Jun 11, 2004 3:48 pm    Post subject: Reply with quote

tobasfxp wrote:



but when i change my grub.conf in :

replacing
Code:

kernel-gentoo.2.6.5-gentoo-r1

with
Code:

bzImage

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
View user's profile Send private message
tobasfxp
n00b
n00b


Joined: 02 Jun 2004
Posts: 23

PostPosted: Fri Jun 11, 2004 10:06 pm    Post subject: Reply with quote

ok im in and iptables works

Tobas
Back to top
View user's profile Send private message
tobasfxp
n00b
n00b


Joined: 02 Jun 2004
Posts: 23

PostPosted: Fri Jun 11, 2004 10:14 pm    Post subject: Reply with quote

i only have 1 more question :oops:

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
View user's profile Send private message
hardcore
l33t
l33t


Joined: 01 Nov 2003
Posts: 626
Location: MSU, MI

PostPosted: Sat Jun 12, 2004 6:22 pm    Post subject: Reply with quote

You might want to post this as a new topic in the networking section, you'll get some help there.
Back to top
View user's profile Send private message
megalomani
Tux's lil' helper
Tux's lil' helper


Joined: 08 Jun 2004
Posts: 77

PostPosted: Sat Jun 12, 2004 6:44 pm    Post subject: Reply with quote

look in /etc/resolv.conf

nameserver
Back to top
View user's profile Send private message
tobasfxp
n00b
n00b


Joined: 02 Jun 2004
Posts: 23

PostPosted: Sat Jun 12, 2004 11:11 pm    Post subject: Reply with quote

thx everything works now m88


Tobas
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
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