HELP! iptable problem

Issues related to configuring your network
Post Reply
ilemon
Posts: 3
Joined: 2007/10/09 18:48:30

HELP! iptable problem

Post by ilemon » 2007/10/18 23:06:44

The question is a little bit long......

System A: Centos 4.4
2 network interfaces:
“eth0” connected to Internet through a router, and IP address 192.168.0.100 is given.
“tz0” is a wireless device which can connect to System B, and it's internal IP address is 11.11.1.1 (which is known by System B)

System B: Centos 4.4
2 network interfaces:
“eth0” with no connection
“tz0” is a wireless device which can connect to System A, and it's internal IP address is 11.11.1.2 (which is known by System A)

Problem:
I want to use System A as a network gateway, or something that can redirect the Internet traffic to System B. For example, System B can browse “www.google.com” without any ethernet cable plugged in its “eth0”.

I was told that I can achive this by doing something to the iptable. And I found a website that has the following:

“> To setup the Firewall/NAT, first enable the IP forwarding, by changing the 0 to a 1 on the net.ipv4.ip_forward line of the /etc/sysctl.conf file.
>
> Then, replace the contents of /etc/sysconfig/iptables with the following:
..........................
”
My question are:
1.I change the net.ipv4.ip_forward's value in sysctl.conf file, but I cannot find the “/etc/sysconfig/iptables”.
2.What change should i make in the iptable if the file is found?

Thank you very much!!

yyagol
Posts: 1015
Joined: 2006/06/10 18:27:44
Location: 32 4′N 34 47′E
Contact:

HELP! iptable problem

Post by yyagol » 2007/10/22 06:41:59

You can just write the iptables rules and then run [b]service iptables save[/b]
this action will save all rules to the /etc/sysconfig/iptables file .

ilemon
Posts: 3
Joined: 2007/10/09 18:48:30

Re: HELP! iptable problem

Post by ilemon » 2007/10/22 21:20:55

thank you!
do you mean I am going to create this "iptable" file?

yyagol
Posts: 1015
Joined: 2006/06/10 18:27:44
Location: 32 4′N 34 47′E
Contact:

Re: HELP! iptable problem

Post by yyagol » 2007/11/08 06:51:09

no need to create the file this will do once running the
[b]service iptables save[/b] command

as for net.ipv4.ip_forward this line needs to go in /etc/sysctrl.conf
with a value of 0 ro 1 (net.ipv4.ip_forward=1)

Post Reply

Return to “CentOS 4 - Networking Support”