2P,wan口DHCP模式不支持热插拔(自带固件/公版固件/自编译结果均一样)

三台路由器:
RouterA: 192.168.1.0/24
RouterB: 192.168.2.0/24
Wrtnode2P: 唯一有线接口更改为WAN
 
使用2P,分别上联RouterA、RouterB;
if [ 开机时连接的是RouterA && Wan自动获取到192.168.1.xxx ];
then [ 连到RouterB ] ;
[ ifconfig eth0.2显示的依然是RouterA的IP  \
WAN口获取不到RouterB_IP:192.168.2.xxx  \
或者说获取的RouterB网段的IP没有写入到网卡上 ] ;
 
#反之依然
else [ 网线连接RouterB后,开机 ] ;then [ 热插拔至RouterA
[ Wan_IP依然是RouterB的 ]
 
本人因个人爱好接触openwrt,时间很短,请教各位大大,是哪里出问题了?我又该修改哪里呢?
root@wrtnode:~# cat /etc/config/network 

config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'
option ula_prefix 'fdb4:eede:5f0f::/48'

config interface 'lan'
option ifname 'eth0.1'
option force_link '1'
option macaddr '64:51:**:**:**:**'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.8.1'
option netmask '255.255.255.0'

config interface 'wan'
option force_link '1'
option macaddr '64:51:**:**:**:**'
option proto 'dhcp'
option _orig_ifname 'eth0.2'
option ifname 'eth0.2'
option _orig_bridge 'false'

config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'

config switch_vlan
option device 'switch0'
option vlan '1'
option ports '1 2 3 4 6t'

config switch_vlan
option device 'switch0'
option vlan '2'
option ports '0 6t'

root@wrtnode:~# cat /sys/kernel/uevent_helper
/sbin/hotplug
root@wrtnode:~# cat /etc/config/dhcp
config dnsmasq
option domain 'lan'
option expandhosts '1'
option nonegcache '1'
option authoritative '1'
option rebind_protection '0'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.auto'
option noresolv '1'
list server '127.0.0.1#5353'
option cachesize '9999'

config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv6 'server'
option ra 'server'

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'

root@wrtnode:~# cat /etc/hotplug.d/iface/00-netstate
[ ifup = "$ACTION" ] && {
uci_toggle_state network "$INTERFACE" up 1
[ -n "$DEVICE" ] && {
uci_toggle_state network "$INTERFACE" device "$(uci -q get network.$INTERFACE.ifname)"
uci_toggle_state network "$INTERFACE" ifname "$DEVICE"
}

root@wrtnode:~# cat /etc/hotplug.d/iface/20-firewall
#!/bin/sh

[ "$ACTION" = ifup -o "$ACTION" = ifupdate ] || exit 0
[ "$ACTION" = ifupdate -a -z "$IFUPDATE_ADDRESSES" -a -z "$IFUPDATE_DATA" ] && exit 0

/etc/init.d/firewall enabled || exit 0

fw3 -q network "$INTERFACE" >/dev/null || exit 0

logger -t firewall "Reloading firewall due to $ACTION of $INTERFACE ($DEVICE)"
fw3 -q reload
}

root@wrtnode:~# cat /etc/hotplug.d/iface/25-dnsmasq
#!/bin/sh

[ "$ACTION" = ifup ] || exit 0

/etc/init.d/dnsmasq enabled && /etc/init.d/dnsmasq restart



已邀请:

pp187002776

赞同来自:

还需要其它文件的源代码的话,尽管开口

xzmu - 10w

赞同来自:

这个应该是驱动的问题,openwrt提供7628的ethernet的驱动并未通知hotplud.d这个拔插的事件

pp187002776

赞同来自:

目前必须使用/etc/init.d/network restart 或者 kill udhcpc 才能更新IP地址,但是这样太蠢了。。。好麻烦

xzmu - 10w

赞同来自:

这个目前还没啥太好的解决办法,主要是芯片本身提供的端口变化的方式不适合用于通知上层接口

hades

赞同来自:

mt7628还有开发潜力,,,有的搞,,

要回复问题请先登录注册