Hello, I am working on a project for college where I am building a router out of a CentOS 6.5 machine. I have 2 NICs. One NIC will be hooked up to a linksys E2000 that is connected to my modem, and the other NIC will be hooked up to a WRT54GL running DDWRT and acting as a switch.
THIS IS NOT CURRENTLY HOW IT IS SET UP BUT IT WILL BE
Everything I have done so far has been from what I have either read on similar posts here or other websites.
The E2000 is on the 192.168.1.0/24 network on eth0.
The WRT54 is going to be on the 192.168.2.0/24 network on eth1... that's the plan anyway.
Currently eth1 is hooked up to another PC which will be explained below. This is just until I know that I have the 2 networks talking then I will hook up eth1 to the WRT54 and continue.
I am having issues being able to talk from one subnet to the other. I more so just want to be pointed in the right direction rather than someone telling me word for word what I need to type into the CLI to get this to work.
So far I am just to trying to establish basic connectivity. I have edited my IPTABLES to just allow everything. I know it's not safe, but I want to get basic connectivity to work before I start setting rules and restricting stuff. Plus this is all internal at the moment so I really have nothing to fear at this point.
My /etc/sysconfig/iptables looks like this.
Code:
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -j ACCEPT
-A OUTPUT -j ACCEPT
-A FORWARD -i eth0 -j ACCEPT
-A FORWARD -i eth1 -j ACCEPT
COMMIT
/etc/sysconfig/network-scripts/ifcfg-eth0
Code:
DEVICE=eth0
TYPE=Ethernet
HWADDR=00:40:CA:6E:58:6A
UUID=ef6f090f-273b-42bf-8ec7-acb8c7bc9d04
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=192.168.1.201
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
BROADCAST=192.168.1.255
/etc/sysconfig/network-scripts/ifcfg-eth1
Code:
DEVICE=eth1
HWADDR=00:A0:C9:2A:DC:A7
TYPE=Ethernet
UUID=eeb93c55-063d-4666-bb70-17672a87f798
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=192.168.2.1
NETMASK=255.255.255.0
BROADCAST=192.168.2.255
I currently have another PC hooked up to eth1 with a static IP of 192.168.2.2 255.255.255.0 and a gateway of 192.168.2.1 with Google's DNS servers. I can't even get that PC to ping the CentOS box or vice versa. I think my problem is I need to set up static routes in /etc/sysconfig/network-scripts/route-eth0 and route-eth1. I have tried many different configurations and I think I am probably just doing something wrong with it. Currently they are.
route-eth0
Code:
[root@Centos network-scripts]# vim route-eth0
192.168.2.0/24 via 192.168.1.201 dev eth0
and route-eth1
Code:
[root@Centos network-scripts]# vim route-eth1
192.168.1.0/24 via 192.168.2.0 eth1
I have ipv4 forwarding enabled in the sysctl.conf file.
Code:
[root@Centos sysconfig]# vim /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
At this point I am lost. I have tried all sorts of different things. Please tell me what I am doing wrong. Thanks in advance.