03-27-2018, 01:23 PM
I'll specify the details.
There is a WiFi network 192.168.0.0/24 with the access point at 192.168.0.1 and the laptop at 192.168.0.8.
Assume the laptop has to act as a router. Following the aforementioned instructions I've created network 192.168.0.0/24 the the Ethernet interface of the laptop has ip 192.168.2.1. All the commands:
Locally, now you can ping both laptop's ips: 192.168.1.8 and 192.168.2.1. The current config is:
Then I've set the rock64's Ethernet interface using `nmtui`: ip is 192.168.2.2/24, gateway is 192.168.2.1. From now I can ping local ip 192.168.2.2 but not the gateway. Checking the laptop's arp table I can't see the MAC of the rock64. Hence, I guess, no packets even sent via the cable.
So, the question is... what to do next?
There is a WiFi network 192.168.0.0/24 with the access point at 192.168.0.1 and the laptop at 192.168.0.8.
Assume the laptop has to act as a router. Following the aforementioned instructions I've created network 192.168.0.0/24 the the Ethernet interface of the laptop has ip 192.168.2.1. All the commands:
Code:
sudo ifconfig eth0 up
sudo ifconfig eth0 192.168.2.1
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
sudo iptables -t nat -A POSTROUTING -o wlan0 -s 192.168.2.0/24 -j MASQUERADE
Locally, now you can ping both laptop's ips: 192.168.1.8 and 192.168.2.1. The current config is:
Code:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether ETH0-MAC brd ff:ff:ff:ff:ff:ff
inet 192.168.2.1/24 brd 192.168.2.255 scope global eth0
valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether WLAN0-MAC brd ff:ff:ff:ff:ff:ff
inet 192.168.1.8/24 brd 192.168.1.255 scope global wlan0
valid_lft forever preferred_lft forever
Then I've set the rock64's Ethernet interface using `nmtui`: ip is 192.168.2.2/24, gateway is 192.168.2.1. From now I can ping local ip 192.168.2.2 but not the gateway. Checking the laptop's arp table I can't see the MAC of the rock64. Hence, I guess, no packets even sent via the cable.
So, the question is... what to do next?