Networking Forums

Networking Forums > Computer Networking > Linux Networking > sharing internet with iptables

Reply
Thread Tools Display Modes

sharing internet with iptables

 
 
Cothbw
Guest
Posts: n/a

 
      07-26-2004, 05:02 PM
I've got a problem with iptables => sharing internet (can't connect to the
internet with my client)

I use mandrake 9.2 firewall guarddog and have a asdl-ppp0 connection.

To use the gateway of my server I got the advise to set up the server
like this:

1. first disable firewall
2. # echo 1 > /proc/sys/net/ipv4/ip_forward
3. # iptables -t nat -A POSTROUTING -o ppp0 -j MASQURADE

After that:
4. # iptables -t nat -L

no message

It should be something like:
------------------------------
Chain PREROUTING (policy ACCEPT)
target prot opt source destination

Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
--------------------------------------------------

I hope someone can help me solve this problem (firewall related?), in a
dutch newsgroup I got some suggestions but they all failed.

Regards Cothbw


More info:

- Ifconfig:

eth0 Link encap:Ethernet HWaddr 00:04:23:1E:92:05
inet addr:10.0.0.10 Bcast:10.0.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:25478 errors:0 dropped:0 overruns:0 frame:0
TX packets:12400 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:17533314 (16.7 Mb) TX bytes:1114002 (1.0 Mb)
Interrupt:20 Base address:0x1000

eth1 Link encap:Ethernet HWaddr 00:10:B5:08:43:CC
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:28 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:7196 (7.0 Kb) TX bytes:240 (240.0 b)
Interrupt:21 Base address:0x3f00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:182 errors:0 dropped:0 overruns:0 frame:0
TX packets:182 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:9426 (9.2 Kb) TX bytes:9426 (9.2 Kb)

ppp0 Link encap:Point-to-Point Protocol
inet addr:62.234.99.23 P-t-P:62.234.96.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:945 errors:0 dropped:0 overruns:0 frame:0
TX packets:995 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:72634 (70.9 Kb) TX bytes:50892 (49.6 Kb)

- route:


Destination Gateway Genmask Flags Metric Ref Use Iface
c3eea6001.cable * 255.255.255.255 UH 0 0 0 ppp0
10.0.0.0 * 255.255.255.0 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default c3eea6001.cable 0.0.0.0 UG 0 0 0 ppp0




















 
Reply With Quote
 
 
 
 
Alex Harsch
Guest
Posts: n/a

 
      07-26-2004, 05:57 PM
Cothbw wrote:

> I've got a problem with iptables => sharing internet (can't connect to the
> internet with my client)
>
> I use mandrake 9.2 firewall guarddog and have a asdl-ppp0 connection.
>
> To use the gateway of my server I got the advise to set up the server
> like this:
>
> 1. first disable firewall
> 2. # echo 1 > /proc/sys/net/ipv4/ip_forward
> 3. # iptables -t nat -A POSTROUTING -o ppp0 -j MASQURADE
>
> After that:
> 4. # iptables -t nat -L
>
> no message
>
> It should be something like:
> ------------------------------
> Chain PREROUTING (policy ACCEPT)
> target prot opt source destination
>
> Chain POSTROUTING (policy ACCEPT)
> target prot opt source destination
> MASQUERADE all -- anywhere anywhere
>
> Chain OUTPUT (policy ACCEPT)
> target prot opt source destination
> --------------------------------------------------
>
> I hope someone can help me solve this problem (firewall related?), in a
> dutch newsgroup I got some suggestions but they all failed.
>
> Regards Cothbw
>
>
> More info:
>
> - Ifconfig:
>
> eth0 Link encap:Ethernet HWaddr 00:04:23:1E:92:05
> inet addr:10.0.0.10 Bcast:10.0.0.255 Mask:255.255.255.0
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:25478 errors:0 dropped:0 overruns:0 frame:0
> TX packets:12400 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:100
> RX bytes:17533314 (16.7 Mb) TX bytes:1114002 (1.0 Mb)
> Interrupt:20 Base address:0x1000
>
> eth1 Link encap:Ethernet HWaddr 00:10:B5:08:43:CC
> inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:28 errors:0 dropped:0 overruns:0 frame:0
> TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:100
> RX bytes:7196 (7.0 Kb) TX bytes:240 (240.0 b)
> Interrupt:21 Base address:0x3f00
>
> lo Link encap:Local Loopback
> inet addr:127.0.0.1 Mask:255.0.0.0
> UP LOOPBACK RUNNING MTU:16436 Metric:1
> RX packets:182 errors:0 dropped:0 overruns:0 frame:0
> TX packets:182 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
> RX bytes:9426 (9.2 Kb) TX bytes:9426 (9.2 Kb)
>
> ppp0 Link encap:Point-to-Point Protocol
> inet addr:62.234.99.23 P-t-P:62.234.96.1 Mask:255.255.255.255
> UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
> RX packets:945 errors:0 dropped:0 overruns:0 frame:0
> TX packets:995 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:3
> RX bytes:72634 (70.9 Kb) TX bytes:50892 (49.6 Kb)
>
> - route:
>
>
> Destination Gateway Genmask Flags Metric Ref Use
> Iface
> c3eea6001.cable * 255.255.255.255 UH 0 0 0
> ppp0
> 10.0.0.0 * 255.255.255.0 U 0 0 0
> eth0
> 192.168.1.0 * 255.255.255.0 U 0 0 0
> eth1
> 127.0.0.0 * 255.0.0.0 U 0 0 0 lo
> default c3eea6001.cable 0.0.0.0 UG 0 0 0
> ppp0

Hello,

try
/usr/sbin/iptables -P FORWARD ACCEPT
to make sure that forwarding is allowed and
echo 1 > /proc/sys/net/ipv4/ip_dynaddr
for dynamicIP/masquerading.
Alex
 
Reply With Quote
 
Cothbw
Guest
Posts: n/a

 
      07-26-2004, 07:06 PM
> Hello,
>
> try
> /usr/sbin/iptables -P FORWARD ACCEPT
> to make sure that forwarding is allowed and
> echo 1 > /proc/sys/net/ipv4/ip_dynaddr
> for dynamicIP/masquerading.
> Alex


Thx
Tried both and after that tried iptables -t nat -L
nothing...

This is the result of some testing:

[root@Tdesktop t]# iptables --help
iptables --help
[root@Tdesktop t]# iptables
[root@Tdesktop t]# iptables --help
[root@Tdesktop t]# iptables
[root@Tdesktop t]# man iptables
[root@Tdesktop t]# iptables
iptables

You can see that the command iptables doesnt result in an output and
sometimes only with the command itself.

could it be that my iptables are corrupt
can I uninstall and install iptables?

 
Reply With Quote
 
Alex Harsch
Guest
Posts: n/a

 
      07-28-2004, 08:02 AM
Cothbw wrote:

>> Hello,
>>
>> try
>> /usr/sbin/iptables -P FORWARD ACCEPT
>> to make sure that forwarding is allowed and
>> echo 1 > /proc/sys/net/ipv4/ip_dynaddr
>> for dynamicIP/masquerading.
>> Alex

>
> Thx
> Tried both and after that tried iptables -t nat -L
> nothing...
>
> This is the result of some testing:
>
> [root@Tdesktop t]# iptables --help
> iptables --help
> [root@Tdesktop t]# iptables
> [root@Tdesktop t]# iptables --help
> [root@Tdesktop t]# iptables
> [root@Tdesktop t]# man iptables
> [root@Tdesktop t]# iptables
> iptables
>
> You can see that the command iptables doesnt result in an output and
> sometimes only with the command itself.
>
> could it be that my iptables are corrupt
> can I uninstall and install iptables?

Hi,

yes indeed, you should get some output from executing these commands. Try to
verify the package rpm -Vf `which iptables`. Good luck, Alex
 
Reply With Quote
 
Cothbw
Guest
Posts: n/a

 
      08-01-2004, 09:10 AM

> yes indeed, you should get some output from executing these commands. Try to
> verify the package rpm -Vf `which iptables`. Good luck, Alex


After uninstall and install the iptables were working like they should.
Thx!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba / internet iptables CCW Linux Networking 0 05-05-2008 11:53 AM
iptables NAT for sharing net balavignesh Linux Networking 5 05-15-2006 03:22 AM
Internet Gateway device created in Network Connections when I removed Internet Connection Sharing Martin Underwood Home Networking 2 04-07-2005 12:56 PM
Iptables - nat and internet access from server carlos.yanez.s@gmail.com Linux Networking 1 03-12-2005 07:28 PM
IPTABLES: -d (destination)=Internet AcCeSsDeNiEd Linux Networking 2 10-02-2004 11:36 AM



1 2 3 4 5 6 7 8 9 10 11