I have a server with two NIC cards. Right now eth0 is connected to my router to my ISP. But i want to setup eth1 as my LAN so deliver an internet connection from the server to my laptop.

How can i setup my eth1 as a LAN while my eth0 is a WAN.

I am running CENTOS 6.4 terminal.


echo 1 > /proc/sys/net/ipv4/ip_forwarding

will enable IP forwarding. You need to put this in a startup script for it to persist after boot. You can also set this kernel setting in sysctl.conf (wherever it is on CentOS).

You also need to look into iptables to set up some basic security, as well as NAT if you need it.

| improve this answer | |
  • Its not working I tried making settings in the eth0 and eth1 – sonicboom Jun 26 '13 at 19:15
  • Try flushing all iptables rules adminsehow.com/2009/08/how-to-clear-all-iptables-rules Also make sure all machines behind this one have a static IP in the same subnet as your eth1, or you could install and configure a DHCP server such as isc-dhcp-server or udhcpd on this system. – LawrenceC Jun 26 '13 at 19:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.