LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-21-2002, 06:33 PM   #1
kwigibo
Member
 
Registered: Apr 2002
Posts: 53

Rep: Reputation: 15
IP Masquerading


Hi trying to setup IP Masquerading, and it isn't working. This is what is on the router.

Code:
[root@localhost root]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:30:BD:09:4E:A0
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:625 errors:0 dropped:0 overruns:0 frame:0
          TX packets:30 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:42344 (41.3 Kb)  TX bytes:2164 (2.1 Kb)
          Interrupt:9 Base address:0xf000

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:213 errors:0 dropped:0 overruns:0 frame:0
          TX packets:213 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:21784 (21.2 Kb)  TX bytes:21784 (21.2 Kb)

ppp0      Link encap:Point-to-Point Protocol
          inet addr:139.86.23.197  P-t-P:139.86.23.1  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:569 errors:1 dropped:0 overruns:0 frame:0
          TX packets:564 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:268790 (262.4 Kb)  TX bytes:155934 (152.2 Kb)

[root@localhost root]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
139.86.23.1     0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         139.86.23.1     0.0.0.0         UG    0      0        0 ppp0
[root@localhost root]# ipchains -L
Chain input (policy ACCEPT):
Chain forward (policy DENY):
target     prot opt     source                destination           ports
MASQ       all  ------  192.168.0.0          anywhere              n/a
MASQ       all  ------  192.168.0.0          anywhere              n/a
Chain output (policy ACCEPT):
[root@localhost root]#


Here is the stuff for the other computer
Code:
[root@localhost root]# ssh 192.168.0.2
root@192.168.0.2's password:
Last login: Mon Sep 23 09:31:23 2002 from fred.dj.com
[root@fred root]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
[root@fred root]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:00:E8:DD:7F:E1
          inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:939 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1386 errors:0 dropped:0 overruns:0 carrier:0
          collisions:4 txqueuelen:100
          RX bytes:85306 (83.3 Kb)  TX bytes:168464 (164.5 Kb)
          Interrupt:9 Base address:0xdc00

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:13125 errors:0 dropped:0 overruns:0 frame:0
          TX packets:13125 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:930109 (908.3 Kb)  TX bytes:930109 (908.3 Kb)

[root@fred root]# ipchains -L
Chain input (policy ACCEPT):
Chain forward (policy ACCEPT):
Chain output (policy ACCEPT):
[root@fred root]#
Thanks
 
Old 09-21-2002, 06:47 PM   #2
AltF4
Member
 
Registered: Sep 2002
Location: .at
Distribution: SuSE, Knoppix
Posts: 532

Rep: Reputation: 31
try enabling forwarding in your kernel somewhere in your init.d *.rc files

# echo "Enabling IP forwarding"
# echo "1" > /proc/sys/net/ipv4/ip_forward
 
Old 09-21-2002, 07:12 PM   #3
kwigibo
Member
 
Registered: Apr 2002
Posts: 53

Original Poster
Rep: Reputation: 15
yeah I did that echo command. But still cant access the internet on the other computer. Does the above output look right?
 
Old 09-21-2002, 07:46 PM   #4
AltF4
Member
 
Registered: Sep 2002
Location: .at
Distribution: SuSE, Knoppix
Posts: 532

Rep: Reputation: 31
looks ok to me (except it shows up twice)

what commands did you use to set up masquerading ?

more infos: http://www.tldp.org/HOWTO/IP-Masquerade-HOWTO/

-------------------
# sample script
# enable ip forwarding in kernel
echo 1 > /proc/sys/net/ipv4/ip_forward
# flush rules
ipchains -F
ipchains -P forward DENY
# hide internal net behind ppp0
ipchains -A forward -i ppp0 -s 192.168.0.0/255.255.255.0 -j MASQ
------------
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IP Masquerading mugwump84 Linux - Newbie 5 05-03-2005 09:30 AM
IP Masquerading ? emailssent Linux - Networking 1 10-07-2004 10:49 PM
help ip masquerading campusloop Linux - Networking 1 05-20-2004 12:37 PM
IP masquerading. somebody help me! Johnsernickle Linux - Networking 4 10-22-2002 06:57 PM
ip masquerading artman62 Linux - Security 5 08-13-2002 07:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration