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.
|
|
01-30-2014, 04:47 AM
|
#1
|
Member
Registered: Aug 2013
Distribution: Arch, Debian, Slackware
Posts: 333
Rep:
|
How do I route internet in from wlan0 and out through eth0 in debian/centOS?
I've tried doing this by blackboxing it, didn't work out well. Tried googling, and didn't come up with much of anything that was helpful.
Essentially I want to be able to take the internet access I have through wifi, and pass it through a traffic filter and out the ethernet connection to a switch or directly to another system. Ie, use my laptop to access the internet via wifi, and provide that access to another system(s) over ethernet. I'd prefer a method that doesn't require some third-party application, and doesn't rely on a GUI, to the extent possible.
I've never done anything like this so I'll really need a step by step, newbie-friendly format if that's doable.
I'm using debian on a thinkpad t60p, but I dualboot with centOS so being able to do it in both will be necessary.
|
|
|
01-30-2014, 05:37 AM
|
#2
|
Member
Registered: Jan 2014
Distribution: CentOS, Fedora, Ubuntu
Posts: 108
Rep:
|
I think below is relevant for you. For your case, eth1 at this document will be wlan0 I guess
http://www.cyberciti.biz/faq/rhel-fe...sharing-howto/
|
|
1 members found this post helpful.
|
01-30-2014, 04:50 PM
|
#3
|
Member
Registered: Aug 2013
Distribution: Arch, Debian, Slackware
Posts: 333
Original Poster
Rep:
|
Quote:
Originally Posted by myatthu
|
So according to this, my internal is eth0 and external is wlan0?
Now, while this is brilliant, do you know if this method works for debian?
|
|
|
01-30-2014, 08:03 PM
|
#4
|
Member
Registered: Jan 2014
Distribution: CentOS, Fedora, Ubuntu
Posts: 108
Rep:
|
Yes. According to your initial post, eth0 is internal and wlan0 is wan.
For debian flavour, iptables rules are sane but network interfaces config file will be different.
Pls refer below excellent guide for debian flavour
http://www.debuntu.org/iptables-how-to-share-your-internet-connection/
|
|
1 members found this post helpful.
|
01-30-2014, 08:20 PM
|
#5
|
Member
Registered: Aug 2013
Distribution: Arch, Debian, Slackware
Posts: 333
Original Poster
Rep:
|
Quote:
Originally Posted by myatthu
Yes. According to your initial post, eth0 is internal and wlan0 is wan.
For debian flavour, iptables rules are sane but network interfaces config file will be different.
Pls refer below excellent guide for debian flavour
http://www.debuntu.org/iptables-how-...et-connection/
|
That's interesting that the same method won't work with debian because the "sysctl.conf" exists in debian as well. Do they do different things between the two OSes?
|
|
|
01-31-2014, 03:26 AM
|
#6
|
Member
Registered: Aug 2013
Distribution: Arch, Debian, Slackware
Posts: 333
Original Poster
Rep:
|
Also, is there an easy was to, essentially, "turn on/off" the internet sharing? I'd like to be able to control it easily without deleting/re-adding rules and such.
|
|
|
01-31-2014, 11:19 AM
|
#7
|
Member
Registered: Jan 2014
Distribution: CentOS, Fedora, Ubuntu
Posts: 108
Rep:
|
This guide is specific for debian flavour.
http://chrisjrob.com/2011/03/14/shar...ethernet-port/
In order to automate or run as service, you just need basic script skill and can create custom init script.
PS: Pls thank to original writer for his good guide
|
|
1 members found this post helpful.
|
01-31-2014, 02:37 PM
|
#8
|
Member
Registered: Aug 2013
Distribution: Arch, Debian, Slackware
Posts: 333
Original Poster
Rep:
|
Quote:
Originally Posted by myatthu
|
Brilliant, thanks for the alternate guide.
As far as the init script, I'm not 100% sure what that script would need to do. I'm guessing the following:
Code:
[when first run]
test if the following is already in place{
bring the eth connection down, set to static ip
set the rules for iptables
uncomment the lines in /etc/dnsmasq.conf
}
[then when run again]
test if the above is running, and if so complete the following{
comment out the lines in /etc/dnsmasq.conf
remove/hide/disable the rules for iptables
bring eth down, reset to take dynamic ip
}
Is that right, or am I thinking about it incorrectly? I've never written a script like this, and an init script seems all the more complicated if I want to bring the sharing service up/down at will.
|
|
|
01-31-2014, 06:56 PM
|
#9
|
Member
Registered: Jan 2014
Distribution: CentOS, Fedora, Ubuntu
Posts: 108
Rep:
|
You can take a look /etc/rc.d/init.d directory for build in scripts for other services.
You can put your requirements accordingly.
|
|
|
All times are GMT -5. The time now is 10:11 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
|
|