LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   how to load tun in RedHat (https://www.linuxquestions.org/questions/linux-server-73/how-to-load-tun-in-redhat-806800/)

unminser 05-09-2010 11:38 AM

how to load tun in RedHat
 
how to load tun in RedHat

Code:

uname -a
Linux server 2.6.18-028stab067.4 #1 SMP Thu Jan 14 17:06:11 MSK 2010 x86_64 x86_64 x86_64 GNU/Linux


TB0ne 05-09-2010 11:45 AM

Quote:

Originally Posted by unminser (Post 3962260)
how to load tun in RedHat

Code:

uname -a
Linux server 2.6.18-028stab067.4 #1 SMP Thu Jan 14 17:06:11 MSK 2010 x86_64 x86_64 x86_64 GNU/Linux


What version of RedHat are you using? And what 'tun' do you mean? The "Tun" emulator? Or the one for bridging? Asking a complete question with useful information, will get you help faster.

This link might help you.
http://www.lmgtfy.com/?q=linux+tun+load+howto+redhat

unminser 05-09-2010 11:48 AM

http://www.linuxquestions.org/questi...un-tap-806675/

how to check RedHat ?

doesnt uname -a works?

unminser 05-09-2010 11:57 AM

im new to linux i thought uname -a give the system inofrmation

Quote:

CentOS release 5.4 (Final)

catkin 05-09-2010 12:28 PM

I've done a bit of netsearching and it seems that CentOS 5.4 by default has a tun loadable module so it's surprising that /sbin/modprobe tun doesn't work, doesn't find the tun.ko file. Let's see if it exists. Please try
Code:

find / -type f -iname '*tun*'

unminser 05-09-2010 12:38 PM

it dont have tun.ko
Quote:

[root@server etc]# find / -type f -iname '*tun*'
/usr/include/linux/if_tun.h
/usr/include/linux/if_tunnel.h
/usr/local/bin/htund
/usr/libexec/usermin/tunnel/tunnel-lib.pl
/usr/libexec/usermin/blue-theme/pptp-client/images/tunnel.gif
/usr/libexec/webmin/pptp-client/images/tunnel.gif
/usr/libexec/webmin/tunnel/tunnel-lib.pl
/usr/libexec/webmin/fdisk/tunefs.cgi
/usr/libexec/webmin/fdisk/tunefs_form.cgi
/usr/libexec/webmin/shorewall/images/tunnels.gif
/usr/libexec/webmin/stunnel/edit_stunnel.cgi
/usr/libexec/webmin/stunnel/stunnel-lib.pl
/usr/libexec/webmin/stunnel/images/tunnel.jpg
/usr/libexec/webmin/stunnel/save_stunnel.cgi
/usr/libexec/webmin/stunnel/delete_tunnels.cgi
/usr/libexec/webmin/blue-theme/pptp-client/images/tunnel.gif
/usr/lib64/libstunnel.so
/usr/src/redhat/BUILD/openvpn-2.1.1/tun.h
/usr/src/redhat/BUILD/openvpn-2.1.1/tun.c
/usr/src/redhat/BUILD/openvpn-2.1.1/tun.o
/usr/sbin/stunnel3
/usr/sbin/stunnel
/usr/sbin/tunelp
/usr/share/man/fr/man8/stunnel.8.gz
/usr/share/man/man8/tune2fs.8.gz
/usr/share/man/man8/stunnel.8.gz
/usr/share/man/man8/tunelp.8.gz
/usr/share/man/man2/getunwind.2.gz
/usr/share/man/pl/man8/stunnel.8.gz
/usr/share/terminfo/f/fortune
/usr/share/doc/openssh-4.3p2/README.tun
/usr/share/doc/initscripts-8.45.30/ipv6-tunnel.howto
/usr/share/doc/iproute-2.6.18/ip-tunnels.ps
/usr/share/doc/stunnel-4.15/faq.stunnel-2.html
/usr/share/doc/stunnel-4.15/stunnel-pop3s-client.conf
/usr/share/doc/stunnel-4.15/stunnel-sfinger.conf
/usr/share/doc/stunnel-4.15/stunnel.conf-sample
/usr/share/doc/stunnel-4.15/VNC_StunnelHOWTO.html
/usr/share/zoneinfo/posix/Africa/Tunis
/usr/share/zoneinfo/posix/America/Pangnirtung
/usr/share/zoneinfo/Africa/Tunis
/usr/share/zoneinfo/right/Africa/Tunis
/usr/share/zoneinfo/right/America/Pangnirtung
/usr/share/zoneinfo/America/Pangnirtung
/sbin/tune2fs
/sbin/iptunnel
/root/openvpn-2.1.1/tun.h
/root/openvpn-2.1.1/tun.c
/root/openvpn-2.1.1/.deps/tun.Po
/root/openvpn-2.1.1/tun.o
/etc/sysconfig/network-scripts/ifup-tunnel
/etc/sysconfig/network-scripts/ifdown-tunnel
/etc/httpd/conf.d/swtune.conf

unminser 05-10-2010 04:40 PM

how to add sbin to the $PATH ?

http://www.webhostingtalk.com/showthread.php?t=922960
http://www.webhostingtalk.com/showthread.php?t=595436
http://www.osresources.com/11_6_en.html

summarize the thread.

catkin 05-11-2010 01:24 AM

Quote:

Originally Posted by unminser (Post 3963833)
how to add sbin to the $PATH ?

For logon shells it is normally done in /etc/profile, for root at least.

In a script you can use export PATH="$PATH:/sbin".

You may also want /usr/local/sbin and /usr/sbin.

I'm not sure of the usefulness of the links regards getting tun support into the kernel which is your current stumbling block. I confess to not reading the big one past the second page but there was no mention of having to do anything special to do so. This confirms the earlier research that suggested tun support is there by default. Has the kernel been rebuilt since installation? Clearly tun.ko is not present and the fix for that is to build a new kernel -- or reinstall to get it back to default which I believe includes it.

unminser 05-11-2010 04:21 PM

Quote:

# /etc/profile

# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc

pathmunge () {
if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
if [ "$2" = "after" ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
fi
}

# ksh workaround
if [ -z "$EUID" -a -x /usr/bin/id ]; then
EUID=`id -u`
UID=`id -ru`
fi

# Path manipulation
if [ "$EUID" = "0" ]; then

pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
fi

# No core files by default
ulimit -S -c 0 > /dev/null 2>&1

if [ -x /usr/bin/id ]; then
USER="`id -un`"
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"
fi

HOSTNAME=`/bin/hostname`
HISTSIZE=1000

if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
INPUTRC=/etc/inputrc
fi

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC


for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
if [ "$PS1" ]; then
. $i
else
. $i >/dev/null 2>&1
fi
fi
done

unset i
unset pathmunge
where should i add it?

i just going to post in openvpn community.
Quote:

build a new kernel
does that mean everything will be erased?

catkin 05-12-2010 01:27 AM

Quote:

Originally Posted by unminser (Post 3964977)
where should i add it?

i just going to post in openvpn community.

does that mean everything will be erased?

The part that begins with if [ "$EUID" = "0" ]; then adds the sbin directories when running as root; they're not much use for other users because the commands in the sbin directories mostly need to be run as root. If you still want them for a non-root user then better to do it on a per-user basis rather than system-wide so better set PATH in ~/.bash_profile for login shells and ~/.bashrc for non-login shells.

Linux is designed so you can build a new kernel without erasing anything and choose between old and new kernels at boot time.

unminser 05-17-2010 09:50 AM

Quote:

if [ "$EUID" = "0" ]; then
PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin"
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
Quote:

[root@server /]# modprobe
bash: modprobe: command not found
[root@server /]# /sbin/modprobe
Usage: /sbin/modprobe [-v] [-V] [-C config-file] [-n] [-i] [-q] [-b] [-o <modname>] <modname> [parameters...]
/sbin/modprobe -r [-n] [-i] [-v] <modulename> ...
/sbin/modprobe -l -t <dirname> [ -a <modulename> ...]
it didnt work.
how to build a new kernel ?


All times are GMT -5. The time now is 09:04 PM.