need some information

Discussion regarding the installation and configuration of Linux distributions.
Post Reply
sahil_1160
Cadet
Posts: 2
Joined: Sat Jul 28, 2007 2:05 am
Contact:

need some information

Post by sahil_1160 »

any one please check this and tell me this is right or wrong



[root@net root]# vi /etc/hosts.allow
#
# hosts.allow This file describes the names of the hosts which are
# allowed to use the local INET services, as decided
# by the '/usr/sbin/tcpd' server.
#
ALL: 212.93.192.4
ALL: 212.93.192.5
in.named: ALL
ALL: 192.168.100.1
~
~
~
~
~
~
~
~
~
~
~
~
~
"/etc/hosts.allow" 10L, 247C 1,1
All


[root@net root]# vi /proc/sys/net/ipv4/ip_forward
1
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"/proc/sys/net/ipv4/ip_forward" 1L, 2C 1,1
All



[root@net root]# vi /etc/sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 1

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1





[root@net root]# vi /etc/inittab
#
# inittab This file describes how the INIT process should set up
# the system in a certain run-level.
#
# Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
# Modified for RHS Linux by Marc Ewing and Donnie Barnes
#

# Default runlevel. The runlevels used by RHS are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have
networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
#
id:3:initdefault:

# System initialization.
si::sysinit:/etc/rc.d/rc.sysinit

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6

# Trap CTRL-ALT-DELETE
ca::ctrlaltdel:/sbin/shutdown -t3 -r now

# When our UPS tells us power has failed, assume we have a few minutes
# of power left. Schedule a shutdown for 2 minutes from now.
# This does, of course, assume you have powerd installed and your
# UPS connected and working correctly.
pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"

# If power was restored before the shutdown kicked in, cancel it.
pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"


# Run gettys in standard runlevels
1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6

# Run xdm in runlevel 5
x:5:respawn:/etc/X11/prefdm -nodaemon
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~

42,0-1 Bot


"/etc/inittab" 53L, 1666C
18,1 Top

~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~

[root@net root]# vi /etc/resolv.conf
search netexpress.net
#nameserver 127.0.0.1
nameserver 212.93.192.4
nameserver 212.93.192.5
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"/etc/resolv.conf" 5L, 116C
1,1 All

1,1 All

[root@net root]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.0.105 net.netexpress.net net
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"/etc/hosts" 4L, 185C
1,1 All


[root@net root]# vi /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
/root/ipt
/root/arp
/root/qos
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~









[root@net root]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=net.netexpress.net
#GATEWAY=192.168.1.254
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"/etc/sysconfig/network" 3L, 66C
1,1 All

~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"/etc/rc.local" 10L, 250C
10,1 All

TO CHANGE IP ADDRESS THE COMMAND IS
/sbin/ifconfig eth0 192.168.100.1 netmask 255.255.255.0 broasdcast
192.168.100.255 up
/sbin/route add default gw 192.168.0.60


[root@net root]# vi ipt
#/etc/rc.d/init/named restart
#/bin/echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/ifconfig eth0 192.168.0.105 netmask 255.255.255.0 broadcast
192.168.0.255 up
/sbin/route add default gw 192.168.0.60
#/sbin/ifconfig eth1:1 192.168.100.254 netmask 255.255.255.0 broadcast
192.168.100.255 up
/sbin/iptables -F
/sbin/iptables -F -t nat
/sbin/iptables -A POSTROUTING -t nat -s 192.168.100.0/24 -o eth0 -j
MASQUERADE
/sbin/iptables -A FORWARD -p icmp -j DROP
#/sbin/iptables -t nat -A PREROUTING -s 192.168.100.0/24 -p tcp --dport 80
-j REDIRECT --to-port 8080
~
~
~





chmod 755 owner group others 4+2+1
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"ipt" 16L, 1004C
16,0-1 All

Ips

Eth0: 192.168.0.105
subnet:255.255.255.0
gatway: 192.168.0.60
Dns:212.93.192.4
Seconday Dns: 212.93.192.5

Eth01: 192.168.100.254
subnet:255.255.255.0

i will configure every thing is ok but i have 2 problems
1) chmod permission
2) vi ipt sepeed Control file


so please tell me
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Post by LinuxFreaK »

Dear sahil_1160,
Salam,

I do not understand what you are trying to do ?

Changing Permission

# chmod 755 /root/ipt
# chmod 755/root/arp
# chmod 755/root/qos


Best Regards.
Farrukh Ahmed
lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Post by lambda »

~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
hameedkhan
Havaldaar
Posts: 141
Joined: Wed Apr 07, 2004 12:58 am
Location: Karachi, Pakistan

Post by hameedkhan »

May be he doesn't like doing a cat :P
Thanks,
Hameed U. Khan
Linux User #: 354374
Post Reply