SlackwareThis Forum is for the discussion of Slackware Linux.
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.
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.
I have an ASUS router connected to my ISP's (Spectrum) cable modem. I currently have a cable outage. I would like to set up my LAN to use my 4G hotspot.
On the computer with the wireless adapter, ALPHA, I have in /etc/rc.d/rc.inet1.conf:
Code:
# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]="yes"
IFNAME[4]="wlan0"
IPADDR[4]=""
NETMASK[4]=""
USE_DHCP[4]="yes"
and on another computer, BETA, on the LAN, no wireless, I have:
Code:
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]="yes"
If both eth0 and wlan0 are enabled on ALPHA I can get to BETA, but not to the Internet. If I have eth0 disabled on ALPHA I can get to the Internet, but not to BETA. I need both. I've tried adding the following to ALPHA:
But that didn't work. Maybe I specified it wrongly.
The ASUS has been the DHCP server for the wired devices giving 192.168.0.17 to ALPHA:eth0 and 192.168.0.15 to BETA:eth0. The hotspot gives 192.168.43.82 to ALPHA:wlan0.
I can get to ALPHA on 192.168.0.17 from BETA, but not to ALPHA 192.43.82 from BETA. I cannot get to the Internet from BETA
I want ALPHA:wlan0 to be my LAN network Internet gateway for all hosts on the LAN. All LAN hosts have wired connections, so they could use their eth0 interfaces to talk to each other. Whether the wired interfaces should use the ASUS for DHCP serving I don't know.
So, what do I need to do to get BETA to talk to the Internet and have ALPHA able to talk to both BETA *and* the Internet?
So, you think it should work as is? It's not. Should I hard-code the IP addresses for the wire interfaces and not use DHCP? If I do give ALPHA:eth0 a static address, I can connect to the Internet. I'll experiment with other hosts on the LAN.
ALPHA is the computer with the wireless adapter and gets its IP via DHCP from the HotSpot. The eth0's are wired connections on the LAN. Simply, what I want, is for LAN communication to route via the wired connections and Internet traffic to route via the ALPHA:wlan0 interface.
As I've got this configured, it doesn't work. I have to stop the ALPHA:eth0 device (leaving only wlan0 connected) or I cannot get to the Internet. I can't get to the Internet at all from BETA via the wired connection. I know I have something set wrong.
Should I specify the gateway on BETA as ALPHA:eth0 instead of the hotspot? Do I need a bridge specified?
Wlan0 and eth0 can not be on the same subnet. Keep it as 192.168.0.x
Not sure I get what you're saying. wlan0 and eth0 were on different subnets: 192.168.43.0/24 for wlan0 and 192.168.0.0/24 for eth0. What are you saying I should keep as 192.168.0.x?
Richard Cranium: I had to reset things back to using the ISP stuff in order to get work done. So my experimentation with this may be spotty going forward, but it is something I need to sort out, so I'll continue pursuing it.
The eth0 devices are set as static, no DHCP, rc.inet1:
IPADDR[0]="192.168.43.14"
NETMASK[0]="255.255.0.0"
GATEWAY="192.168.43.1"
Your basically trying to configure ALPHA as a NAT device. It should be relatively simple. The IP tables rules and IP forwarding as posted. The clients need an IP address, gateway and DNS name server info verify the route is correct.
I had to reset things back to using the ISP stuff in order to get work done. So my experimentation with this may be spotty going forward, but it is something I need to sort out, so I'll continue pursuing it.
The eth0 devices are set as static, no DHCP, rc.inet1:
IPADDR[0]="192.168.43.14"
NETMASK[0]="255.255.0.0"
GATEWAY="192.168.43.1"
Yes, you're right. I've tried various combinations and lost track of that.
Quote:
Your basically trying to configure ALPHA as a NAT device. It should be relatively simple. The IP tables rules and IP forwarding as posted. The clients need an IP address, gateway and DNS name server info verify the route is correct.
So, I'm missing the "simple" bit, and I agree, it should be. What am I missing? I'll try this again soon if I get some ideas.
If I keep the eth0 (wired) devices on the various machines as static (BETA):
Code:
IPADDR[0]="192.168.0.15"
NETMASK[0]="255.255.0.0"
and let the wlan0 on ALPHA get its IP from the hotspot (which will be 192.168.43.82); AND I have:
... set on ALPHA, what else do I need? What should the GATEWAY be specified as on BETA? Should I use ALPHA's eth0 (which would be 192.168.0.17), or ALPHA's wlan0 address? What should be in BETA's resolv.conf? I believe I've tried multiple combinations of these things, but I've certainly confused myself by now.
BETA's gateway should be the IP address of ALPHA's eth0. The resolv.conf can be any valid DNS nameserver i.e. as provided by your ISP or a public DNS like Google (8.8.8.8 or 8.8.4.4). Also make sure you have a good routing table i.e. look at the output of the route command.
BETA's gateway should be the IP address of ALPHA's eth0. The resolv.conf can be any valid DNS nameserver i.e. as provided by your ISP or a public DNS like Google (8.8.8.8 or 8.8.4.4). Also make sure you have a good routing table i.e. look at the output of the route command.
Thanks - that IP for BETA's gateway should help. I'll try this shorty. About the nameserver, yes I could use a public nameserver like 8.8.8.8, but I'd like to use the ISP name server. Of course, I can't use my wired ISP's nameserver since this is a backup for when the wired system is down. The hotspot's IP is 192.168.43.1. Could I use that for a nameserver? If so, will that work in BETA's resolv.conf if its IP is 192.168.0.15? Should I rather use ALPHA's 192.168.0.17 IP as the nameserver?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.