Open hayzamjs opened 10 months ago
@jow- , I have created an interface with dhcp client protocol named iptv without default gateway option. ifstatus iptv shows this record correctly:
inactive -> route -> nexthop: 100.112.84.1
But when i leave blank the gateway (see image attachment), "traceroute 10.31.44.26" says no route to host(this is dhcpserver). NETIFD can't read inactive -> route -> nexthop value. On the page it says: if omitted the gateway from the parent interface is taken. It works only when I enter gateway 100.112.84.1 manually, but when I reboot the device default route is changed, I enter it manually again.
{
"up": true,
"pending": false,
"available": true,
"autostart": true,
"dynamic": false,
"uptime": 183,
"l3_device": "wan.103",
"proto": "dhcp",
"device": "wan.103",
"updated": [
"addresses",
"routes",
"data"
],
"metric": 0,
"dns_metric": 0,
"delegation": true,
"ipv4-address": [
{
"address": "100.XXX.XX.44",
"mask": 22
}
],
"ipv6-address": [
],
"ipv6-prefix": [
],
"ipv6-prefix-assignment": [
],
"route": [
{
"target": "10.63.0.0",
"mask": 20,
"nexthop": "0.0.0.0",
"source": "0.0.0.0/0"
},
{
"target": "10.31.0.0",
"mask": 16,
"nexthop": "0.0.0.0",
"source": "0.0.0.0/0"
}
],
"dns-server": [
],
"dns-search": [
],
"neighbors": [
],
"inactive": {
"ipv4-address": [
],
"ipv6-address": [
],
"route": [
{
"target": "0.0.0.0",
"mask": 0,
"nexthop": "100.112.84.1",
"source": "100.XXX.XX.44/32"
}
],
"dns-server": [
"XXX.74.0.5",
"XXX.74.1.5"
],
"dns-search": [
],
"neighbors": [
]
},
"data": {
"dhcpserver": "10.31.44.26",
"leasetime": 3600
}
@gntcs That's weird when I set the gateway manually like this it works fine (and persists):
config route
option table '47167'
option interface 'BSNLTrunk'
option target '0.0.0.0/0'
option gateway '10.148.96.1'
Without a different route it works fine as well, just that when I add a route without setting a gateway to an interface that is not point to point (like VPN/4G/PPPoE) it doesn't work
@hayzamjs No problem when I specify gateway address manually, it works. The problem is when the router is rebooted, the ip address and the gateway is changed (PROTO=DHCP), I have to add new gateway again manually.
IMO, IF ISEMPTYORNULL(LUCI-STATICROUTING-GATEWAY) THEN DYNAMICGWIP = getIFACEIPfromINACTIVE-route-nexthop(IPTV); foreach route.iptv.gateway= DYNAMICGWIP IF 0.0.0.0 no route. IF ADDEDMANUALY=accept static gateway ip.
See route->"nexthop": "0.0.0.0", IT must be empty "", not "0.0.0.0".
This is my network config:
This is my firewall config:
Before I set anything up, I can ping
172.30.249.11
and172.30.249.33
by using the commandping <ip> -I lan4
, what I want to achieve is all packets directed to these IPs (and some other IPs that I will add later) to automatically use lan4 (BSNLTrunk). I can see the following data in the overview page as well:Now this is my setup :
0.0.0.0/0
to172.30.249.0/24
using these nftables rules:/usr/share/nftables.d/chain-pre/mangle_output/0-pbr.nft :
/usr/share/nftables.d/chain-pre/mangle_prerouting/0-pbr.nft :
/etc/config/network
file:Now I should ideally be able to ping 172.30.249.0/24 from anywhere in the network right? But that's not the case the pings seemingly go nowhere and the traceroute (from the router to the range) looks like this:
Also I should note that in the overview page the gateway has turned into 0.0.0.0?
Now I should add that I use the same method to PBR using other interfaces (My 4G interface, some wireguard interfaces) and they all work perfectly fine except this one interface. Also when I add the gateway '10.148.96.1' to this route:
It works as expected again (setting the interface BSNLTrunk to a different routing table also works), but I don't want to use the gateway as it's not reliable and prone to change in my case, I want to use the interface directly. I have tried everything I could think of but I can't seem to get it to work. A user on the forum told me it might be a bug so thought I'd post it here.