Open jaylfc opened 4 years ago
I really haven't got time to test script recently
I wish I knew enough to fix it, I’ll keep playing around, if I manage anything I’ll post on here!
Any news on this? Got the same problem!! Script work fine. It runs without errors, but the devices I connect to the ethernet are simply not detected nor assigned an IP
I do not RPi right now with me.
Can u guys try to execute the steps in scripts 1 by 1 in console and see which lines throws error ?
Just run the code of wifi-to-eth-route 1 by 1, no errors. I can check in ifconfig that eth0 has a correct IP of 192.168.2.1, with correct mask and gate
Connected my PC to the ethernet of the raspberry. Nothing happens
Ok now it worked. I just rebooted the RPI and now it worked. I need to do some more testing I think
I never got it to function correctly due to the change of networking system in the latest version. I manually created a bridge following Debian guides in the end.
Ok so after some more testing:
I never got it to function correctly due to the change of networking system in the latest version. I manually created a bridge following Debian guides in the end.
Do you have the script? I'm struggling to create it.....
@jaylfc Can u provide clean steps here ?, we can add that to README
I’m out right now, I will have to find the page I used in my history. I will post as soon as back :)
This is the page I used I think:
I think you are using eth-to-wifi, no? So you are getting internet to the rpi from the ethernet and creating a WiFi AP.
I need the other way around: I have internet on WIFI and I want to connect my computer to the ethernet port of the RPI
Nope, I have my pi sharing incoming from wlan0 to Ethernet. I plugged a router into it to create a new separate network and all devices have internet and local connectivity.
Still not working for me.
I've seen that if I run the script WITHOUT anything connected to the ethernet, and then I connect a switch to the port, then it works
If the script is run with something already connected to the ethernet port of the raspberry, it fails
Ok, give me a few hours, I just realised I could open my bash history file and see exactly what I did to get it working. I will post later :)
_**Make sure to:
update-alternatives --config iptables
Change to legacy.**_
The dnsmasq service may need unmasking after installation.
Here is what I did, I have pasted the entire file under each nano command, you should be able to just replace unless you have already made some critical changes to your configs.
sudo apt-get install dnsmasq sudo nano /etc/dhcpcd.conf
interface eth0 static ip_address=192.168.220.1/24 static routers=192.168.220.0
hostname
Use the hardware address of the interface for the Client ID. clientid
Persist interface configuration when dhcpcd exits. persistent
Rapid commit support. Safe to enable by default because it requires the equivalent option set on the server to actually work. option rapid_commit
A list of options to request from the DHCP server. option domain_name_servers, domain_name, domain_search, host_name option classless_static_routes
Respect the network MTU. This is applied to DHCP routes. option interface_mtu
A ServerID is required by RFC2131. require dhcp_server_identifier
Generate SLAAC address using the Hardware Address of the interface
OR generate Stable Private IPv6 Addresses based from the DUID slaac private
sudo service dhcpcd restart sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig sudo nano /etc/dnsmasq.conf
interface=eth0 # Use interface eth0 listen-address=192.168.220.1
Specify the address to listen on Bind to the interface server=8.8.8.8 # Use Google DNS domain-needed
Don'tforward short names bogus-priv # Drop the non-routed address spaces. dhcp-range=192.168.220.50,192.168.220.150,12h # IP range and lease time
sudo nano /etc/sysctl.conf
net.ipv4.ip_forward=1
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward" sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE sudo reboot sudo systemctl restart dnsmasq.service sudo systemctl daemon-reload sudo sh -c "iptables-save > /etc/iptables.ipv4.nat" sudo nano /etc/rc.local
rc.local This script is executed at the end of each multiuser runlevel. Make sure that the script will "exit 0" on success or any other value on error. In order to enable or disable this script just change the execution bits. By default this script does nothing. Print the IP address _IP=$(hostname -I) || true if [ "$_IP" ]; then printf "My IP address is %s\n" "$_IP" fi
iptables-restore < /etc/iptables.ipv4.nat
exit 0
sudo nano /etc/iptables.ipv4.nat
Generated by iptables-save v1.8.2 on Sun May 17 21:34:45 2020 *filter :INPUT ACCEPT [8429:5899839] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [7033:785423] -A FORWARD -i wlan0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT -A FORWARD -i eth0 -o wlan0 -j ACCEPT COMMIT
Completed on Sun May 17 21:34:45 2020 Generated by iptables-save v1.8.2 on Sun May 17 21:34:45 2020 *nat :PREROUTING ACCEPT [183:33480] :INPUT ACCEPT [183:33480] :OUTPUT ACCEPT [197:14662] :POSTROUTING ACCEPT [20:2492] -A POSTROUTING -o wlan0 -j MASQUERADE COMMIT
Completed on Sun May 17 21:34:45 2020
sudo systemctl restart dnsmasq.service sudo systemctl daemon-reload
If its not working maybe reboot.
Hope this helps!
Hi everyone, is your problem solved?
I seem to meet the same problem and created a PR for a fix I would offer you to test (if applicable) https://github.com/arpitjindal97/raspbian-recipes/pull/50
Any help is welcome! =)
Well I don't think the problem is solved.. I found out that the script still only works when there is nothing connected to the ethernet-port. I have to boot the Pi, execute the script, and only then connect a device to the ethernet port, otherwise it will not work. Devices will get an ip-address, but always state 'no internet connection'. I don't know how to help directly, but I'm loving the script so I'm hoping we can solve this thing together.
Hi,
I love these scripts and have used them for a while now. Since the Raspbian update they no longer work. I tried changing my default by to iptables legacy and unmasked dnsqmask and the script now runs without errors but doesn’t actually work.
Any ideas?
Thanks in advance!