IPv4 NAT entry and DHCP Server
Step :1
- Install UNIX server
- configure ipaddress manually
- install openssh server---for Remote login
Note:don't insert secondary LAN card UNIX installation time
Step:2
- shutdown the system
- insert secondary LAN card
- configure ipaddress for secondary lancard
- //etc/network/interfaces
Step:i /etc/network/interfaces
vi /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 10.20.30.77
netmask 255.255.255.0
gateway 10.20.30.1
network 10.20.30.0
broadcast ten.20.30.255
dns-nameservers ten.20.30.15 10.20.30.16
dns-search codeghar.com
auto eth1
iface eth1 inet static
address 172.22.22.1
netmask 255.255.255.0
network 172.22.22.0
broadcast 172.22.22.255
step:ii /etc/sysctl.conf
vi /etc/sysctl.conf
And uncomment the road
# net.ipv4.ip_forward=1
so that it currently seems as
net.ipv4.ip_forward=1
Step:iii
sysctl -w internet.ipv4.ip_forward=1
Step:iv /etc/rc.local
vi /etc/rc.local
Make sure the subsequent 2 lines seem before the exit zero line within the file.
/sbin/iptables -P FORWARD settle for
/sbin/iptables --table nat -A POSTROUTING -o eth0 -j MASQUERADE
Step:v
iptables -P FORWARD settle for
iptables –-table nat -A POSTROUTING -o eth0 -j MASQUERADE
Step:vi Restart Networkin Services
/etc/init.d/networking stop
/etc/init.d/networking begin
Step:vii chckout eth0 and eth1 area unit up or not
ifconfig eth0 up
ifconfig eth1 up
Step :3 Install DHCP server
Step:i Install DHCP server
yum install dhcp-server
Step:ii /etc/dhcp/dhcpd.conf
vi /etc/dhcp/dhcpd.conf
The file is incredibly well commented and you'll be able to learn plenty reading it. simply check that it's a minimum of the subsequent configuration.
ddns-update-style none;
# possibility definitions common to any or all supported networks...
option domain-name "codeghar.com";
option domain-name-servers ten.20.30.15, 10.20.30.16;
default-lease-time 3600;
max-lease-time 7200;
# If this DHCP server is that the official DHCP server for the native
# network, the authoritative directive ought to be uncommented.
authoritative;
# Use this to send dhcp log messages to a special log file (you additionally
# have to be compelled to hack syslog.conf to finish the redirection).
log-facility local7;
# this can be a really basic subnet declaration.
subnet 172.22.22.0 netmask 255.255.255.0
Step :iii /etc/default/isc-dhcp-server
vi /etc/default/isc-dhcp-server
The line can seem like this before you alter it
INTERFACES=""
And when you alter it, it'll seem like this:
INTERFACES="eth1"
Step:4 stop and begin the DHCP server
- service isc-dhcp-server stop
- service isc-dhcp-server begin
Thank you for sharing such a wonderful Information !!
ReplyDeleteHere is a list of Top LINUX INTERVIEW QUESTIONS
Veritas Cluster Interview Questions
Redhat Cluster Suite Commands
SAMBA Server Interview Questions
Linux FTP vsftpd Interview Questions
SSH Interview Questions
Apache Interview Questions
Nagios Interview questions
IPTABLES Interview Questions
Ldap Server Interview Questions
LVM Interview questions
Sendmail Server Interview Questions
YUM Interview Questions
NFS Interview Questions
Tcpdump Command Examples & Usages
Example of YUM Commands
How to rewrite outgoing address in Postfix
Read More at :- Linux Troubleshooting