Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-05-2005, 04:45 AM
|
#1
|
Member
Registered: Aug 2003
Location: New Delhi, India
Distribution: RH 9, RH 8, RH 7.3,Slackware
Posts: 123
Rep:
|
Internet Sharing : IP Masquerade
Dear All,
I have the following setup working ...
To ISP provider <-----eth1 <------Linux Box <--------eth0 <--------ethX <------ Anybox
------------------192.168.1.3--------------------172.16.56.201-----172.16.56.206-------------
both eth0 and eth1 are on Linux Box
By keeping gateway as 172.16.56.201 on anybox, i am able to ping 192.168.1.3 but i am not able to access internet.
Now will IP Masquerade work in this case as well? How to access internet from Anybox?
Internet is working on Linux Box.
Regards
xing
Last edited by Xing; 08-05-2005 at 04:54 AM.
|
|
|
08-05-2005, 11:17 PM
|
#2
|
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870
|
Re: Internet Sharing : IP Masquerade
Quote:
Originally posted by Xing
Dear All,
I have the following setup working ...
To ISP provider <-----eth1 <------Linux Box <--------eth0 <--------ethX <------ Anybox
------------------192.168.1.3--------------------172.16.56.201-----172.16.56.206-------------
both eth0 and eth1 are on Linux Box
By keeping gateway as 172.16.56.201 on anybox, i am able to ping 192.168.1.3 but i am not able to access internet.
Now will IP Masquerade work in this case as well? How to access internet from Anybox?
Internet is working on Linux Box.
Regards
xing
|
first, you'll need to do SNAT or MASQUERADE on "Linux Box"... something like this example:
Code:
echo 0 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/conf/all/rp_filter
iptables -F FORWARD
iptables -P FORWARD DROP
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i eth0 -o eth1 -m state --state NEW -j ACCEPT
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
as for "Anybox", i'm not sure cuz i don't understand that part of your diagram...
in other words, i understand this part:
Quote:
To ISP provider <-----eth1 <------Linux Box <--------eth0
|
but i don't understand this part:
Quote:
<--------ethX <------ Anybox
------------------192.168.1.3--------------------172.16.56.201-----172.16.56.206-------------
|
Last edited by win32sux; 08-05-2005 at 11:22 PM.
|
|
|
08-06-2005, 06:55 AM
|
#3
|
Member
Registered: Aug 2003
Location: New Delhi, India
Distribution: RH 9, RH 8, RH 7.3,Slackware
Posts: 123
Original Poster
Rep:
|
Quote:
but i don't understand this part:
quote:
--------------------------------------------------------------------------------
<--------ethX <------ Anybox
------------------192.168.1.3--------------------172.16.56.201-----172.16.56.206-------------
|
it should be more clear this way
eth1 = 192.168.1.3
eth0 = 172.16.56.201
ethx = 172.16.56.206
Anybox is a windows machine with ethx as the LAN Card.
regards
xing
|
|
|
08-06-2005, 04:57 PM
|
#4
|
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870
|
so Anybox is a windows box with three NICs, right??
what's the IP of eth0 on Linux Box??
Last edited by win32sux; 08-06-2005 at 05:18 PM.
|
|
|
08-09-2005, 01:25 AM
|
#5
|
Member
Registered: Aug 2003
Location: New Delhi, India
Distribution: RH 9, RH 8, RH 7.3,Slackware
Posts: 123
Original Poster
Rep:
|
Dear win32sux,
if you look att he diagram; anybox, which is a windows machine has just one NIC card.. and linux box has two NIC cards..
eth0(172.16.x.x) and eth1(192.168.x.x) are NIC cards on linux box and anybox has a NIC card ethx (172.16.y.y)
i hope this makes things clear..
regards
xing
|
|
|
08-09-2005, 01:52 AM
|
#6
|
Member
Registered: Feb 2004
Location: Kathmandu
Distribution: Redhat/fedora/Suse [Wanna Drive With Debian]
Posts: 208
Rep:
|
so are windows box now able to browse the internet or not??
|
|
|
08-10-2005, 05:01 AM
|
#7
|
Member
Registered: Aug 2003
Location: New Delhi, India
Distribution: RH 9, RH 8, RH 7.3,Slackware
Posts: 123
Original Poster
Rep:
|
No, the winboxes are not able to browse internet as of now
|
|
|
08-10-2005, 07:14 AM
|
#8
|
Member
Registered: Feb 2004
Location: Kathmandu
Distribution: Redhat/fedora/Suse [Wanna Drive With Debian]
Posts: 208
Rep:
|
As i have uderestood understood you following diagram
To ISP provider <-----eth1 <------Linux Box <--------eth0 <--------ethX <------ Anybox
------------------192.168.1.3--------------------172.16.56.201-----172.16.56.206-------------
you should be doing this
iptables -t nat -A POSTROUTING -s 172.16.0.0/16 -o eth1 -j MASQUERADE
#vi /etc/sysctl.conf
# Controls IP packet forwarding
net.ipv4.ip_forward = 0
make it to 1 then save and exit
#/sbin/sysctl.conf -p
#service iptables save
now in the windows machine give the gateway 172.16.56.201
the dns section will be the same like other machines.If you don't know ask your ISP.
|
|
|
All times are GMT -5. The time now is 10:20 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|