Hello All First, sorry by my poor english, hope you understand me :-) I have a problem, i don't understand or don't know how to solve I need to interconnect 2 networks with different numbers. One is 192.168.236.0/24 the other 192.168.1.0/24. Mainly i need to access services in the 236. from the 1. one. I have a CentOS 5.5 machine with 2 nics each one configured to work in one of the nets. The CentOS also uses a router for Internet access that is 192.168.1.1. 192.168.1.0/24 >-----192.168.1.100--[CentOS Machine]--192.168.236.74 --------< 192.168.236.0/24 So, i enable forwarding in the CentOS box echo '1' > /proc/sys/net/ipv4/ip_forward And in one machine of the 1. network (this is Fedora14) I add the route: route add -net 192.168.236.0 netmask 255.255.255.0 gw 192.168.1.100 dev eth0 Since this moment i can ping or access (ssh/http) another CentOS machine in the 236 network ping 192.168.236.74 PING 192.168.236.74 (192.168.236.74) 56(84) bytes of data. 64 bytes from 192.168.236.74: icmp_req=1 ttl=64 time=0.281 ms But can't access or ping other machines (NOT Linux ones), ie, printers, Win servers, etc... Also tried adding: route add 192.168.1.100 eth0 before the route add -net, but no efect. This fails even if i flush IPTables. In the CentOS box that replies, i did nothing, it 'just' works. Can anyone tell what is happening / help me with this? Something to do missing in the CentOS router that joins the networks? Best, -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20101219/6aeb6557/attachment-0002.html>
On 12/19/10 11:07 AM, Jose Maria Terry Jimenez wrote:> Hello All > > First, sorry by my poor english, hope you understand me :-) > > I have a problem, i don't understand or don't know how to solve > > I need to interconnect 2 networks with different numbers. One is > 192.168.236.0/24 the other 192.168.1.0/24. Mainly i need to access services in > the 236. from the 1. one. > > I have a CentOS 5.5 machine with 2 nics each one configured to work in one of > the nets. The CentOS also uses a router for Internet access that is 192.168.1.1. > > 192.168.1.0/24 >-----192.168.1.100--[CentOS Machine]--192.168.236.74 --------< > 192.168.236.0/24 > > So, i enable forwarding in the CentOS box > > echo '1' > /proc/sys/net/ipv4/ip_forward > > And in one machine of the 1. network (this is Fedora14) I add the route: > > route add -net 192.168.236.0 netmask 255.255.255.0 gw 192.168.1.100 dev eth0 > > Since this moment i can ping or access (ssh/http) another CentOS machine in the > 236 network > ping 192.168.236.74 > PING 192.168.236.74 (192.168.236.74) 56(84) bytes of data. > 64 bytes from 192.168.236.74: icmp_req=1 ttl=64 time=0.281 ms > > But can't access or ping other machines (NOT Linux ones), ie, printers, Win > servers, etc... > > Also tried adding: > route add 192.168.1.100 eth0 > > before the route add -net, but no efect. > > This fails even if i flush IPTables. > > In the CentOS box that replies, i did nothing, it 'just' works. > > Can anyone tell what is happening / help me with this? > Something to do missing in the CentOS router that joins the networks?First make sure that you can ping/access those 'other' services from the centos box with 2 nics. It should source from the .236 interface and 'just work'. If not, you have firewalls or something else blocking traffic. When you route other traffic from the .1 network, the destination machines need some reason to send the return packets to the 192.168.236.74 address. You can either add the route to every machine or on the router that is currently their default router. -- Les Mikesell lesmikesell at gmail.com
Hello Jose, from the picture you provided the situation looks pretty simple. - you have enabled IP forwarding on router, I recommend you to put it into /etc/sysctl.conf for persistence. - you have configured firewall rules on router to allow forwarding traffic from left to right subnet. You can also try to set up ACCEPT policy just for testing. - the default gateway for left subnet is 192.168.1.1 (you mentioned router for Internet access). Correct me if I'm wrong. - the default gateway for right subnet I assume is 192.168.236.74. You don't have to do anything with routing here. Every host in right subnet knows where to send replies. - the problem seems to be missing routing information in left subnet. Hosts don't know anything about the right subnet and thus send requests to the default gateway 192.168.1.1. - modifying routing table on every host in left subnet can be solution in case, if there is only a few hosts which need to access right subnet - if you need to have fully accessible subnets, put the static route to default gateway 192.168.1.1 to redirect requests to proper gateway. If it is Linux gateway, try something like this [root at default-gw]# ip route add 192.168.236.0/24 via 192.168.236.74 Regards Andrej Jose Maria Terry Jimenez wrote:> I have a CentOS 5.5 machine with 2 nics each one configured to work in > one of the nets. The CentOS also uses a router for Internet access that > is 192.168.1.1. > > 192.168.1.0/24 >-----192.168.1.100--[CentOS Machine]--192.168.236.74 > --------< 192.168.236.0/24
Seemingly Similar Threads
- Cannot access other computers on LAN
- Cannot access other computers on LAN
- automatically detaching PCI host devices from guest for SRIOV usage.
- Failed to bind to uuid (GUID)._msdcs.DOMAIN NT_STATUS_NO_LOGON_SERVERS & IRPC callback failed for DsReplicaSync - NT_STATUS_IO_TIMEOUT
- Samba3 on multiple networks, how to make it hand out the correct IP?