X86 Wi-Fi to LAN

I've been trying to make my old lapto to work as a router. I simply need it to use it as a Wi-Fi to LAN set up. I'll be connecting a device that has no wifi to my x86 router, I managed to connect my Intel WiFi Chip to my WiFi and the x86 gets internet and everything, but I cannot make the Ethernet port to work as LAN. I've lost count of the times i've had to factory reset to try new ways, Can you guys help me?

If you need the ethernet connected devices to be on the same subnet/network as the upstream wifi network, you need to use relayd to achieve this.

If, on the other hand, it is okay (or even desirable) for the downstream hosts to be on a different subnet, you can use standard routed mode. That is to say that from a default configuration, you'll setup a wwan network which will use the wifi radio to create the uplink, and that will be treated as a wan via the firewall and routing engine. Your downstream devices will be routed. The only other consideration is to ensure that your OpenWrt lan address does not overlap the upstream network's subnet.


1 Like

I got my x86 to connect to my WiFi which would act as WWAN, but whenever I plug the ethernet cable to another computer it doens't assign an IP.. How should I set my /etc/config/network file?

It should be nearly default. The only changes should be the addition of the wwan interface and the possible change of the lan ip addrsss.

I really don't know what i'm doing wrong, for starters I struggle just to get my WiFi going, i followed the guide you sent me and I don't seem to get it to work. :frowning:

Right now I can't even see my WiFi card working.

I'm almost there, I've manage to connect to my WiFi, set it up as WWAN and get an IP from my main router. Now the only thing I'm missing is that when I plug in the Ethernet cable I don't get Internet access, I do get access to the x86 router and I can access LuCi but I don't get Internet.

what is the IP address that you see on your wwan interface?

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall

I made it

        "kernel": "5.15.137",
        "hostname": "OpenWrt",
        "system": "AMD 3020e with Radeon Graphics",
        "model": "HP HP 255 G7 Notebook PC",
        "board_name": "hp-hp-255-g7-notebook-pc",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "23.05.2",
                "revision": "r23630-842932a63d",
                "target": "x86/64",
                "description": "OpenWrt 23.05.2 r23630-842932a63d"

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr ''
        option netmask ''

config globals 'globals'
        option ula_prefix 'fdbb:9274:df55::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr ''
        option netmask ''
        option gateway ''
        option defaultroute '0'
        list dns ''
        list dns ''

config device
        option name 'eth0'

config device
        option name '-'

config interface 'wwan2'
        option proto 'static'
        option ipaddr ''
        option netmask ''
        option gateway ''
        list dns ''

config device
        option name 'phy0-sta0'

cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'pci0000:00/0000:00:01.3/0000:02:00.0'
        option channel '1'
        option band '2g'
        option htmode 'HT20'
        option cell_density '0'
        option country 'MX'

config wifi-iface 'wifinet1'
        option device 'radio0'
        option mode 'sta'
        option network 'wwan2'
        option ssid 'Depa_203_24'
        option encryption 'psk2'
        option key 'xxxxxxxx'

cat /etc/config/dhcp
config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option filterwin2k '0'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option nonegcache '0'
        option cachesize '1000'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option nonwildcard '1'
        option localservice '1'
        option ednspacket_max '1232'
        option filter_aaaa '0'
        option filter_a '0'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option ignore '1'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

cat /etc/config/firewall

config defaults
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option synflood_protect '1'

config zone
        option name 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'
        list network 'lan'
        list network 'wwan2'

Remove the gateway, default route, and dns entires (so the last 4 lines):

Can you confirm that the upstream gateway is indeed at this address?

Delete this:

Remove the ignore line below:

Your firewall file is missing a lot of stuff... what happened to it?

Mainly, you need to put wwan2 into the wan zone (which would normally be pre-populated in the firewall file along with all the default/standard rules that apply to the wan).