Route command related errors

Hello. Recently, my Wi-Fi hasn't been working well, and I've been getting DNS-related errors that have made it unusable. At that time, when I pinged it, I got an error saying bad address 'google.com'. When I tried using the IP directly, I got an error related to network unreachable. When I looked into it, I found that this occurs when the gateway value is *. So, when I executed the command route add default gw 192.168.0.1, I got the error route: SIOCADDRT: Network unreachable, which caused me a problem. At this time, I would like to know how to run the command route add default gw 192.168.0.1 without any errors occurring.
Result of route command:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Interface
192.168.1.0 * 255.255.255.0 U 0 0 0 br-lan

result of ifconfig command:

br-lan Link encap:Ethernet HWaddr D8:3A:DD:13:3D:33
inet addr:192.168.1.5 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::da3a:ddff:fe13:3d33/64 Scope:Link
inet6 addr: fd73:d8f4:7c79::1/60 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:31600 errors:0 dropped:0 overruns:0 frame:0
TX packets:19365 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3235240 (3.0 MiB) TX bytes:1840500 (1.7 MiB)

eth0 Link encap:Ethernet HWaddr D8:3A:DD:13:3D:33
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:31632 errors:0 dropped:0 overruns:0 frame:0
TX packets:19373 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3680008 (3.5 MiB) TX bytes:1840292 (1.7 MiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1113 errors:0 dropped:0 overruns:0 frame:0
TX packets:1113 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:98446 (96.1 KiB) TX bytes:98446 (96.1 KiB)

wlan0 Link encap:Ethernet HWaddr D8:3A:DD:13:3D:35
inet6 addr: fe80::da3a:ddff:fe13:3d35/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:10518 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:1826913 (1.7 MiB)

Use the correct gateway IP. It should be within the 192.168.1.0/24 range.

1 Like

So what value should be entered for the gateway?

Depends on your network setup. It'll be the IP address of whatever device is the gateway for the 192.168.1.0/24 subnet.

1 Like

So, how do I find out the network settings and what are some examples? (Sorry for repeating...)

You do not need to configure anything on the command line.
Assuming you want using your device as an AP/bridge connected to the existing network you need to follow this:

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.