# how to modify files in /proc/sys/net/...

## oharra

I need to place a "1" in the file tcp_syncookies in /proc/sys/net/ipv4/, with echo, but it doesn't work, I'm logged in as root, tried sudo, nothing seems to work. Where can I set those permissions for proc so I can modify that file ? Enable syn cookies in sysctl.conf wasn't a problem tough, but this step is also necessary.

Thanks

----------

## muczy

# /etc/sysctl.conf

#

# For more information on how this file works, please see

# the manpages sysctl( :Cool:  and sysctl.conf(5).

#

# In order for this file to work properly, you must first

# enable 'Sysctl support' in the kernel.

#

# Look in /proc/sys/ for all the things you can setup.

----------

## oharra

 *muczy wrote:*   

> # /etc/sysctl.conf
> 
> #
> 
> # For more information on how this file works, please see
> ...

 

I already modified it there as I said, it's the tcp_syncookies that I need to modify ...

----------

## SkyLine

Are you open/enable this flag in your kernel?

check please Networking in Kernel config file

For example:

```

grep CONFIG_SYN_COOKIES /etc/kernels/kernel-config-x86_64-2.6.23-gentoo-r3

```

----------

## oharra

 *SkyLine wrote:*   

> Are you open/enable this flag in your kernel?
> 
> check please Networking in Kernel config file
> 
> For example:
> ...

 

Thanks for the tip but the directory kernels doesn't exist in /etc here ...

----------

## muczy

grep CONFIG_SYN_COOKIES /usr/src/linux/.config

or

zcat /proc/config.gz | grep CONFIG_SYN_COOKIES

----------

## oharra

 *muczy wrote:*   

> grep CONFIG_SYN_COOKIES /usr/src/linux/.config
> 
> or
> 
> zcat /proc/config.gz | grep CONFIG_SYN_COOKIES

 

Yes I found where that config file is, and it says it's not set there, should I enable it ? Because it says, "Automatically generated make config: don't edit" or do I have to recompile the kernel to do this ?

----------

## muczy

cd /usr/src/linux

make menuconfig...

----------

## oharra

 *muczy wrote:*   

> cd /usr/src/linux
> 
> make menuconfig...

 

> make menuconfig

scripts/kconfig/mconf arch/x86_64/Kconfig

Error opening terminal: unknown.

make[1]: *** [menuconfig] Error 1

make: *** [menuconfig] Error 2

----------

## muczy

Have you ever compiled a self configured kernel?

If no, then:

http://www.google.com/search?q=how+to+compile+linux+kernel&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:hu:official&client=firefox-a[/url]

----------

## SkyLine

What kind of using linux distribution?

----------

## oharra

 *SkyLine wrote:*   

> What kind of using linux distribution?

 

Gentoo offcourse  :Wink: 

----------

## SkyLine

(GOOD.....)

check your packages below 

```

genkernel

gentoo-sources

```

and then run

```

genkernel --menuconfig all

```

----------

## oharra

 *SkyLine wrote:*   

> (GOOD.....)
> 
> check your packages below 
> 
> ```
> ...

 

Okay, where do I find genkernel ?

----------

## SkyLine

As root do following command

```

emerge -v genkernel

emerge -v gentoo-sources

```

----------

## oharra

 *SkyLine wrote:*   

> As root do following command
> 
> ```
> 
> emerge -v genkernel
> ...

 

Thanks, and sorry to bother you again but it gives errors again :

> emerge -v genkernel

Calculating dependencies  >>> Downloading http://mirror.ovh.net/gentoo-distfiles/distfiles/genkernel-3.3.11d.tar.bz2

--13:56:56--  http://mirror.ovh.net/gentoo-distfiles/distfiles/genkernel-3.3.11d.tar.bz2

           => `/usr/portage/distfiles/genkernel-3.3.11d.tar.bz2'

Resolving mirror.ovh.net... 213.186.33.37, 213.186.33.38

Connecting to mirror.ovh.net|213.186.33.37|:80... connected.

HTTP request sent, awaiting response... 404 Not Found

13:56:56 ERROR 404: Not Found.

ns26608 ~ # emerge -v gentoo-sources

Calculating dependencies ...done!

>>> emerge (1 of 1) sys-kernel/gentoo-sources-2.6.16-r7 to /

>>> Resuming download...

>>> Downloading http://mirror.ovh.net/gentoo-distfiles/distfiles/genpatches-2.6.                                             16-9.extras.tar.bz2

--14:04:01--  http://mirror.ovh.net/gentoo-distfiles/distfiles/genpatches-2.6.16                                             -9.extras.tar.bz2

           => `/usr/portage/distfiles/genpatches-2.6.16-9.extras.tar.bz2'

Resolving mirror.ovh.net... 213.186.33.37, 213.186.33.38

Connecting to mirror.ovh.net|213.186.33.37|:80... connected.

HTTP request sent, awaiting response... 404 Not Found

14:04:01 ERROR 404: Not Found.

>>> Resuming download...

>>> Downloading ftp://mirror.ovh.net/gentoo-distfiles/distfiles/genpatches-2.6.1                                             6-9.extras.tar.bz2

--14:04:01--  ftp://mirror.ovh.net/gentoo-distfiles/distfiles/genpatches-2.6.16-                                             9.extras.tar.bz2

           => `/usr/portage/distfiles/genpatches-2.6.16-9.extras.tar.bz2'

Resolving mirror.ovh.net... 213.186.33.38, 213.186.33.37

Connecting to mirror.ovh.net|213.186.33.38|:21... connected.

Logging in as anonymous ... Logged in!

==> SYST ... done.    ==> PWD ... done.

==> TYPE I ... done.  ==> CWD /gentoo-distfiles/distfiles ... done.

==> SIZE genpatches-2.6.16-9.extras.tar.bz2 ... done.

==> PASV ... done.    ==> REST 904 ... done.

==> RETR genpatches-2.6.16-9.extras.tar.bz2 ...

No such file `genpatches-2.6.16-9.extras.tar.bz2'.

>>> Resuming download...

>>> Downloading http://mirrors.tds.net/gentoo/distfiles/genpatches-2.6.16-9.extr                                             as.tar.bz2

--14:04:01--  http://mirrors.tds.net/gentoo/distfiles/genpatches-2.6.16-9.extras                                             .tar.bz2

           => `/usr/portage/distfiles/genpatches-2.6.16-9.extras.tar.bz2'

Resolving mirrors.tds.net... 216.165.129.134

Connecting to mirrors.tds.net|216.165.129.134|:80... connected.

HTTP request sent, awaiting response... 404 Not Found

14:04:01 ERROR 404: Not Found.

>>> Resuming download...

>>> Downloading ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo/distfiles/genpatches-2.                                             6.16-9.extras.tar.bz2

--14:04:01--  ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo/distfiles/genpatches-2.6.                                             16-9.extras.tar.bz2

           => `/usr/portage/distfiles/genpatches-2.6.16-9.extras.tar.bz2'

Resolving ftp.gtlib.cc.gatech.edu... 128.61.111.9, 128.61.111.10, 128.61.111.11

Connecting to ftp.gtlib.cc.gatech.edu|128.61.111.9|:21... connected.

Logging in as anonymous ... Logged in!

==> SYST ... done.    ==> PWD ... done.

==> TYPE I ... done.  ==> CWD /pub/gentoo/distfiles ... done.

==> SIZE genpatches-2.6.16-9.extras.tar.bz2 ... done.

==> PASV ... done.    ==> REST 904 ... done.

==> RETR genpatches-2.6.16-9.extras.tar.bz2 ...

No such file `genpatches-2.6.16-9.extras.tar.bz2'.

>>> Resuming download...

>>> Downloading ftp://lug.mtu.edu/gentoo/source/distfiles/genpatches-2.6.16-9.ex                                             tras.tar.bz2

--14:04:03--  ftp://lug.mtu.edu/gentoo/source/distfiles/genpatches-2.6.16-9.extr                                             as.tar.bz2

           => `/usr/portage/distfiles/genpatches-2.6.16-9.extras.tar.bz2'

Resolving lug.mtu.edu... 141.219.155.230

Connecting to lug.mtu.edu|141.219.155.230|:21... connected.

Logging in as anonymous ... Logged in!

==> SYST ... done.    ==> PWD ... done.

==> TYPE I ... done.  ==> CWD /gentoo/source/distfiles ...

No such directory `gentoo/source/distfiles'.

>>> Resuming download...

>>> Downloading http://distro.ibiblio.org/pub/linux/distributions/gentoo/distfil                                             es/genpatches-2.6.16-9.extras.tar.bz2

--14:04:04--  http://distro.ibiblio.org/pub/linux/distributions/gentoo/distfiles                                             /genpatches-2.6.16-9.extras.tar.bz2

           => `/usr/portage/distfiles/genpatches-2.6.16-9.extras.tar.bz2'

Resolving distro.ibiblio.org... 152.46.7.109

Connecting to distro.ibiblio.org|152.46.7.109|:80... connected.

HTTP request sent, awaiting response... 404 Not Found

14:04:05 ERROR 404: Not Found.

>>> Resuming download...

>>> Downloading http://ftp.gentoo.or.kr/distfiles/genpatches-2.6.16-9.extras.tar                                             .bz2

--14:04:05--  http://ftp.gentoo.or.kr/distfiles/genpatches-2.6.16-9.extras.tar.b                                             z2

           => `/usr/portage/distfiles/genpatches-2.6.16-9.extras.tar.bz2'

Resolving ftp.gentoo.or.kr... 211.189.119.186

Connecting to ftp.gentoo.or.kr|211.189.119.186|:80...

>>> Downloading ftp://mirror.ovh.net/gentoo-distfiles/distfiles/genkernel-3.3.11d.tar.bz2

--13:56:56--  ftp://mirror.ovh.net/gentoo-distfiles/distfiles/genkernel-3.3.11d.tar.bz2

           => `/usr/portage/distfiles/genkernel-3.3.11d.tar.bz2'

Resolving mirror.ovh.net... 213.186.33.38, 213.186.33.37

Connecting to mirror.ovh.net|213.186.33.38|:21... connected.

Logging in as anonymous ... Logged in!

==> SYST ... done.    ==> PWD ... done.

==> TYPE I ... done.  ==> CWD /gentoo-distfiles/distfiles ... done.

==> PASV ... done.    ==> RETR genkernel-3.3.11d.tar.bz2 ... 

No such file `genkernel-3.3.11d.tar.bz2'.

>>> Downloading http://dev.gentoo.org/~plasmaroo/patches/kernel/genkernel/genkernel-3.3.11d.tar.bz2

--13:56:56--  http://dev.gentoo.org/~plasmaroo/patches/kernel/genkernel/genkernel-3.3.11d.tar.bz2

           => `/usr/portage/distfiles/genkernel-3.3.11d.tar.bz2'

Resolving dev.gentoo.org... 140.211.166.183

Connecting to dev.gentoo.org|140.211.166.183|:80... connected.

HTTP request sent, awaiting response... 404 Not Found

13:56:57 ERROR 404: Not Found.

!!! Couldn't download genkernel-3.3.11d.tar.bz2. Aborting.

  ...done!

>>> emerge (1 of 1) sys-kernel/genkernel-3.3.11d to /

----------

## SkyLine

Sure that computer connected internet OR download files at /usr/portage/distfiles

----------

## SkyLine

Sorry Last Post...

Because.... 

The Gentoo mirrrors get active files not older. Update your portage. 

There for please run

```

emerge --sync

```

and then

```

emerge -v genkernel gentoo-sources

```

----------

## oharra

 *SkyLine wrote:*   

> Sorry Last Post...
> 
> Because.... 
> 
> The Gentoo mirrrors get active files not older. Update your portage. 
> ...

 

Thanks, I did that, menuconfig, enabled syncookies in config files & kernel building too with "make". But I still can't place that "1" in tcp_syncookies ?

----------

## SkyLine

Oopss...

```

cat /proc/sys/net/ipv4/tcp_syncookies

```

gives 0 or 1.

Check it.

----------

## oharra

 *SkyLine wrote:*   

> Oopss...
> 
> ```
> 
> cat /proc/sys/net/ipv4/tcp_syncookies
> ...

 

Gives 1  :Smile:  I'm such a linux n00b, I thought there had to be a "1" inside that file and I checked it there always  :Razz: . I restarted network like it said, didn't find the right command at first, than my root partition was full again, I made free space again and things work fine now. So if the tcp_syncookies cats 1 the syncookies work for sure ? I edited the config files before I builded the kernel thats how it had to be right ? Thanks for your help anyway, I think I'm set now  :Smile: 

----------

