Computing.Net > Forums > Linux > RH7.1 iptables

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

RH7.1 iptables

Reply to Message Icon

Original Message
Name: Brian
Date: July 7, 2001 at 10:19:25 Pacific
Subject: RH7.1 iptables
Comment:

Hi, Has anyone successfully setup iptables on a RH7.1 machince with kenrel 2.4? I would like to share my internet connection with my windows 2k. My setup is linux box 2 nic cards, one nic for cable modem(dhcp), the other for Lan (static). If you have done this successfully help me out.


Report Offensive Message For Removal


Response Number 1
Name: yogee
Date: July 7, 2001 at 22:20:08 Pacific
Reply: (edit)

What kind of install did you do? Reason i ask is couse what i did couldnt be done unless i did the full install. Or rather i didnt get something in the smaller install i did get in the full install. Well i can explain and you can try. Its very easy to do with ipmasquerade. You will need ipchains running on bootup along with iptables, unless iptables is M/T. These rules might even work in tables. Havent tried.

First set eth0 (if thats where your internet is coming in),(if not should to make future easier) to dhcp and eth1 to - ip 192.168.0.1 netmask 255.255.255.0 and active at boot. Next you need to enable routing. On the routing spec's turn on network packet forwarding and set your defualt gateway DEVIVE to eth0. REBOOT

The result of this action should be some entries in the /etc/sysconfig/network file. When you are done, the contents of this file should look similar to the following:
NETWORKING=yes
FORWARD_IPV4=yes
HOSTNAME=maple
DOMAINNAME=handsonhistory.com
GATEWAY=
GATEWAYDEV=eth0

(you may not see "FORWARD_IPV4=yes").

(This will open so network pc's can get to the internet and so on.)
To get IP masquerading going on your Red Hat Linux router, you need to define which addresses will be masqueraded and forwarded. Here is an example where all computers on the LAN with a network number of 192.168.0.1/2 are accepted for forwarding and masquerading:
ipchains -P forward DENY
ipchains -A forward -i ppp0 -s 192.168.0.0/255.255.255.0 -j MASQ


To set up your forwarding rules permanently, you can add them to the ipchains configuration file. This will run the rules each time the system reboots (or the network restarts). If you added the rules described above to the /etc/sysconfig/ipchains file, the file would appear as follows:

:input ACCEPT
:forward ACCEPT
-P forward DENY
-A forward -i ppp0 -s 192.168..0.0/255.255.250.0 -j MASQ
:output ACCEPT

At this point, you may want to restart your Linux system.

Adding Windows 9x computers to your LAN

Control panel/network/ "tcp/ip"
Click “Specify an IP address.”
Add the hostname and IP address for this computer. (These should match the name and IP address that you added for this computer for Linux in your Network Configurator window.)
>>>>>add ip of 192.168.0.2/255.255.255.0 and 192.168.0.3 to the next machine.

On your linux system go back in network config and get the "host name' and "dns" served by your dhcp service provider and enter it in windows also. "Name servers" too. Lastley add the gateway to your windows box, which would be the ip of eth1 (192.168.0.1)


Click OK to exit.
At this point, your Windows 9x computer knows to listen on the network (via its Ethernet card) for messages addressed to the IP address you have just entered. From the Windows system, you can access any of the following services configured on your Red Hat Linux system:


Report Offensive Follow Up For Removal

Response Number 2
Name: daan
Date: September 9, 2001 at 00:17:44 Pacific
Reply: (edit)

U cant use ipchains with a 2.4 kernel anymore. What u should use is IPTABLES !

Take a look at the ipmasquerading howto on

www.e-infomax.com/ipmasq

for a explantion of the use of IPTABLES (for routing with a 2.4 kernel)



Report Offensive Follow Up For Removal

Response Number 3
Name: james
Date: December 19, 2001 at 13:08:56 Pacific
Reply: (edit)

I'm not exactly sure what is going on but I'm using RH72 and ipchains to set up my ipmasquerading. It seems to be working fine. Is ipchains not supposed to work?


Report Offensive Follow Up For Removal

Response Number 4
Name: alf
Date: December 26, 2001 at 16:07:08 Pacific
Reply: (edit)

RH 7.1 or RH 7.2.( kernel 2.4) You can use ipchains or iptables. You can not use both of them.


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home








Do you have a Desktop Computer anymore?

No
Yes, but only at work
Yes, but its rarely used
Yes, and its a workhorse


View Results

Poll Finishes In 2 Days.
Discuss in The Lounge
Poll History




Data Recovery Software