Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have configured Centos 6.2 as Gateway machine.its having two interfaces

eth0 with ip that provided by isp 116.x.x.x(Static) and

eth1 connected to modem with ip address 192.168.0.1(no,dns,no dhcp configured yet just ip-forwarding is enabled in router box).

Client machine is configured as:

ip address 192.168.0.5 and gateway 192.168.0.1 Client machines can ping router box(192.168.0.1).but when pinged 8.8.8.8 and gateway of isp provider reply is not reaching Client machines .Its happened after i reboot centos,before that i configure machine and everything working fine. Can u please help me in fixing this.

edit:STEPS FOLLOWED

Router machine:two interfaces eth0:116.X.X.X(static ip) eth1:192.168.0.3 on router

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

iptables -A FORWARD -i eth0 -j ACCEPT

share|improve this question
    
Do you enable ip forward in Centos server? –  Gnouc Jul 12 '13 at 6:19
    
yes i did,everything is going fine before restart,but after restart no connectivity to internet from client side –  vic Jul 12 '13 at 9:10
    
I would expect that the nic connected to "the modem" (eth1) would be the internet facing IP? –  symcbean Jul 12 '13 at 9:57
    
yes eth1 is internet facing ip –  vic Aug 5 '13 at 8:21
    
Couple of things. 1. Double check you ip_forward is still enable sysctl net.ipv4.ip_forward 2. What does your routing table look like route -n 3. You have under you steps followed eth1 is set to 192.168.0.3, is that a typo? –  Ryan Gibbons Aug 9 '13 at 4:05
add comment

1 Answer

up vote 0 down vote accepted

When you say that you enabled ip forwarding, did you set it in sysctl.conf so that it is pervasive across reboots?

Setting it via sysctl -w net.ipv4.ip_forward=1 or echo 1 >/proc/sys/net/ipv4/ip_forward is only good for the current runtime and it is reset to the default or whatever is in /etc/sysctl.conf at boot time.

Also make sure that your iptables rules are getting saved in /etc/sysconfig/iptables

share|improve this answer
    
i did everything as described by you,but still the result is same –  vic Jul 23 '13 at 10:32
    
At this point I would start adding logging rules into iptables -j LOG --log-prefix <some text indicating which table> and running tcpdump -ni eth0 and tcpdump -ni eth1 on the router and see what is happening to the packets. –  numeric illustration Jul 24 '13 at 6:36
    
can elaborate it more,plz.....i configured and install centos and other distro many times,never face such issue,don't know why this time i am facing it.....if possible can you plz give me all steps that has perform while installing and configuring centos as a internet gateway(permanent settingings so that it won't go after restart)...Please its important for me to do it as soon as possible –  vic Jul 24 '13 at 11:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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