1 (edytowany przez wo0t 2021-02-17 16:41:28)

Temat: Konfilkt adresów IP? VLan przypisuje sobie IP

Witam,

nie wiem jak ma to nazwać, ale VLAN 1 w którym działa most "br-lan"  (eth0.1, tap0, wlan0, wlan1) przypisuje sobie sam adres 192.168.1.1 nie wiem na jakiej podstawie. Rodzi to problem, bo WAN korzysta z DHCP i łaczy się z modem/routerem INEA. Dostaje na WAN adres z puli 192.168.1.x/24 od routera INEA oraz brame 192.168.1.1.

no i zaczynają się schody bo 192.168.1.1 to oprócz bramy (INEA) ten sam adres mam na eth0.1

$ ifconfig

br-lan    Link encap:Ethernet  HWaddr 10:FE:ED:E6:31:C2
          inet addr:192.168.100.3  Bcast:192.168.100.255  Mask:255.255.255.0
          inet6 addr: fe80::12fe:edff:fee6:31c2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:217327 errors:0 dropped:0 overruns:0 frame:0
          TX packets:258694 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:29393252 (28.0 MiB)  TX bytes:264123709 (251.8 MiB)

eth0      Link encap:Ethernet  HWaddr 10:FE:ED:E6:31:C2
          inet6 addr: fe80::12fe:edff:fee6:31c2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1786460 errors:0 dropped:0 overruns:41 frame:0
          TX packets:1656932 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2106238214 (1.9 GiB)  TX bytes:1816491199 (1.6 GiB)
          Interrupt:4

eth0.1    Link encap:Ethernet  HWaddr 10:FE:ED:E6:31:C2
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:183011 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1375126 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:18628324 (17.7 MiB)  TX bytes:1757392358 (1.6 GiB)

eth0.2    Link encap:Ethernet  HWaddr 10:FE:ED:E6:31:C2
          inet addr:192.168.1.82  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::12fe:edff:fee6:31c2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1603436 errors:0 dropped:0 overruns:0 frame:0
          TX packets:281786 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2055452855 (1.9 GiB)  TX bytes:52465940 (50.0 MiB)

pomaga dopiero wpisanie...

ip a del 192.168.1.1/24 dev eth0.1

po tym wszystko wraca do normy. Po restarcie routera, znowu mam adres ip na eth0.1


$ ifconfig eth0.1

eth0.1    Link encap:Ethernet  HWaddr 10:FE:ED:E6:31:C2
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0

Jakieś sugestie?

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 interface 'lan'
        option type 'bridge'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ipaddr '192.168.100.3'
        list dns '8.8.8.8'
        list dns '8.8.4.4'
        option ifname 'eth0.1 tap0'

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

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '0t 1'
        option vid '2'

config interface 'WAN'
        option ifname 'eth0.2'
        option proto 'dhcp'

config switch_vlan
        option device 'switch0'
        option vlan '3'
        option ports '0t 2 3 4 5'
        option vid '1'

2

Odp: Konfilkt adresów IP? VLan przypisuje sobie IP

Nie masz jakiegoś procesu który działa na eth0.1? Co to za router?

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

3

Odp: Konfilkt adresów IP? VLan przypisuje sobie IP

Jest to TP-Link WDR-4300

Wcześniej za WAN służył modem Huawei e3372-h123 non-htlink. Łącze okazało się mało wydajne i mało stabilne. Dlatego założony został światłowód. Usunąłem interface WAN z NCM i zrobiłem nowy korzystający z VLan eth0.2. Nie przypominam sobie, żeby jakiś proces korzystał z eth0.1 i tym bardziej z IP 192.168.1.1.

Wszystko odbywało się na adres wewnętrzny sieć z puli 192.168.100.0/24 nie przypominam sobie abym kiedykolwiek korzystał 192.168.1.1.

4

Odp: Konfilkt adresów IP? VLan przypisuje sobie IP

Grepnij sobie pliki np. w /etc zobacz czy tam gdzieś nie ma 192.168.1.1. Ten adres na pewno jest w preinit bo failsafe go ustawia, ale ty nie jesteś w failsafe.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

5 (edytowany przez wo0t 2021-02-17 17:51:13)

Odp: Konfilkt adresów IP? VLan przypisuje sobie IP

coś mi nie działa...

root@TP-LINK:/etc$ find / -type f -exec grep -En '192.168.1.1'
find: -exec requires an argument

ale za to...

find /etc -type f -exec grep -q '192.168.1.1' {} \; -print
/etc/ethers
/etc/rc.local
/etc/config/openvpn_recipes

cat /etc/rc.local

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

/etc/init.d/dnsmasq restart

/etc/init.d/snmpd restart

hdparm -S 60 /dev/sdb

hd-idle

sleep 60

ip a del 192.168.1.1/24 dev eth0.1

exit 0

tylko wpisałem do rc.local usuwanie adres IP z eth0.1

reszta to default cfg z przykładami... adresu 192.168.1.1

próbuje przeszukać całe drzewo katalogu, ale nie bardzo ma ochote współpracować

edit

pusciłem

find / -type f -exec grep -En '192.168.1.1' {} \; -print
i czekam...

6

Odp: Konfilkt adresów IP? VLan przypisuje sobie IP

A /etc/config/openvpn_recipes?

Tak swoją drogą to  grep -r 192.168.1.1 /etc

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

7

Odp: Konfilkt adresów IP? VLan przypisuje sobie IP

Tutaj są jakieś przykłady openvpn.cfg

cat /etc/config/openvpn_recipes

#
# Routed point-to-point server
#
config openvpn_recipe server_tun_ptp
        option _description     'Simple server configuration for a routed point-to-point VPN'
        option _role            'server'
        option dev              'tun'
        option ifconfig         '10.0.0.1 10.0.0.2'
        option secret           'shared-secret.key'
        option keepalive        '10 60'
        option comp_lzo         'yes'
        option verb             '3'
        option mssfix           '1420'

#
# Routed point-to-point client
#
config openvpn_recipe client_tun_ptp
        option _description     'Simple client configuration for a routed point-to-point VPN'
        option _role            'client'
        option dev              'tun'
        list remote             'vpnserver.example.org'
        option ifconfig         '10.0.0.2 10.0.0.1'
        option secret           'shared-secret.key'
        option nobind           '1'
        option comp_lzo         'yes'
        option verb             '3'

#
# Routed multi-client server
#
config openvpn_recipe server_tun
        option _description     'Server configuration for a routed multi-client VPN'
        option _role            'server'
        option dev              'tun'
        option server           '10.0.100.0 255.255.255.0'
        option ca               'ca.crt'
        option cert             'server.crt'
        option key              'server.key'
        option dh               'dh1024.pem'
        option keepalive        '10 60'
        option comp_lzo         'yes'
        option verb             '3'
        option mssfix           '1420'

#
# Routed client
#
config openvpn_recipe client_tun
        option _description     'Client configuration for a routed multi-client VPN'
        option _role            'client'
        option client           '1'
        option dev              'tun'
        list remote             'vpnserver.example.org'
        option pkcs12           'my_client.p12'
        option remote_cert_tls  'server'
        option comp_lzo         'yes'
        option nobind           '1'
        option persist_key      '1'
        option persist_tun      '1'
        option verb             '3'
        option reneg_sec        '0'
        option float            '1'

#
# Multi-client ethernet bridge server
#
config openvpn_recipe server_tap_bridge
        option _description     'Server configuration for an ethernet bridge VPN'
        option _role            'server'
        option dev              'tap'
        option server_bridge    '192.168.1.1 255.255.255.0 192.168.1.128 192.168.1.254'
        option ca               'ca.crt'
        option cert             'server.crt'
        option key              'server.key'
        option dh               'dh1024.pem'
        option keepalive        '10 60'
        option comp_lzo         'yes'
        option verb             '3'
        option mssfix           '1420'

#
# Ethernet bridge client
#
config openvpn_recipe client_tap_bridge
        option _description     'Client configuration for an ethernet bridge VPN'
        option _role            'client'
        option client           '1'
        option dev              'tap'
        list remote             'vpnserver.example.org'
        option ca               'ca.crt'
        option cert             'my_client.crt'
        option key              'my_client.key'
        option dh               'dh1024.pem'
        option remote_cert_tls  'server'
        option comp_lzo         'yes'
        option nobind           '1'
        option persist_key      '1'
        option verb             '3'
        option reneg_sec        '0'
        option float            '1'

8

Odp: Konfilkt adresów IP? VLan przypisuje sobie IP

$ find / -type f -exec grep -En '192.168.1.1' {} \; -print

103:                            lan) ipad=${ipaddr:-"192.168.1.1"} ;;
/rom/bin/config_generate
356:#   option http_proxy "192.168.1.100 8080"
/rom/etc/config/openvpn
72:     option server_bridge    '192.168.1.1 255.255.255.0 192.168.1.128 192.168.1.254'
/rom/etc/config/openvpn_recipes
6:#     02:00:11:22:33:44       192.168.1.1
/rom/etc/ethers
8:pi_ip="192.168.1.1"
/rom/lib/preinit/00_preinit.conf
4829:           -p 192.168.1.1
/rom/usr/bin/etherwake
475:"192.168.1.100 8080",
/rom/usr/lib/lua/luci/model/cbi/openvpn-advanced.lua
29:"192.168.1.1 255.255.255.0 192.168.1.128 192.168.1.254",
/rom/usr/lib/lua/luci/model/cbi/openvpn-basic.lua
7:return;ui.showModal(_('Erasing...'),[E('p',{'class':'spinning'},_('The system is erasing the configuration partition now and will reboot itself when finished.'))]);fs.exec('/sbin/firstboot',['-r','-y']);ui.awaitReconnect('192.168.1.1',
'openwrt.lan');},handleRestore:function(ev){return ui.uploadFile('/tmp/backup.tar.gz',ev.target).then(L.bind(function(btn,res){btn.firstChild.data=_('Checking archive…');return fs.exec('/bin/tar',['-tzf','/tmp/backup.tar.gz']);},this,ev.
target)).then(L.bind(function(btn,res){if(res.code!=0){ui.addNotification(null,E('p',_('The uploaded backup archive is not readable')));return fs.remove('/tmp/backup.tar.gz');}
10:ui.showModal(_('Rebooting…'),[E('p',{'class':'spinning'},_('The system is rebooting now. If the restored configuration changed the current LAN IP address, you might need to reconnect manually.'))]);ui.awaitReconnect(window.location.ho
st,'192.168.1.1','openwrt.lan');},this)).catch(function(e){ui.addNotification(null,E('p',e.message))}).finally(function(){btn.firstChild.data=_('Upload archive...')});},handleBlock:function(hostname,ev){var mtdblock=dom.parent(ev.target,
'.cbi-section').querySelector('[data-name="mtdselect"] select').value;var form=E('form',{'method':'post','action':L.env.cgi_base+'/cgi-download','enctype':'application/x-www-form-urlencoded'},[E('input',{'type':'hidden','name':'sessionid
','value':rpc.getSessionID()}),E('input',{'type':'hidden','name':'path','value':'/dev/mtdblock%d'.format(mtdblock)}),E('input',{'type':'hidden','name':'filename','value':'%s.mtd%d.bin'.format(hostname,mtdblock)})]);ev.currentTarget.paren
tNode.appendChild(form);form.submit();form.parentNode.removeChild(form);},handleSysupgrade:function(storage_size,ev){return ui.uploadFile('/tmp/firmware.bin',ev.target.firstChild).then(L.bind(function(btn,reply){btn.firstChild.data=_('Ch
ecking image…');ui.showModal(_('Checking image…'),[E('span',{'class':'spinning'},_('Verifying the uploaded image file.'))]);return callSystemValidateFirmwareImage('/tmp/firmware.bin').then(function(res){return[reply,res];});},this,ev.tar
get)).then(L.bind(function(btn,reply){return fs.exec('/sbin/sysupgrade',['--test','/tmp/firmware.bin']).then(function(res){reply.push(res);return reply;});},this,ev.target)).then(L.bind(function(btn,res){var keep=E('input',{type:'checkbo
x'}),force=E('input',{type:'checkbox'}),is_valid=res[1].valid,is_forceable=res[1].forceable,allow_backup=res[1].allow_backup,is_too_big=(storage_size>0&&res[0].size>storage_size),body=[];body.push(E('p',_('The flash image was uploaded. B
elow is the checksum and file size listed, compare them with the original file to ensure data integrity. <br /> Click "Proceed" below to start the flash procedure.')));body.push(E('ul',{},[res[0].size?E('li',{},'%s: %1024.2mB'.format(_('
Size'),res[0].size)):'',res[0].checksum?E('li',{},'%s: %s'.format(_('MD5'),res[0].checksum)):'',res[0].sha256sum?E('li',{},'%s: %s'.format(_('SHA256'),res[0].sha256sum)):'']));body.push(E('p',{},E('label',{'class':'btn'},[keep,' ',_('Kee
p settings and retain the current configuration')])));if(!is_valid||is_too_big)
21:ui.awaitReconnect('192.168.1.1','openwrt.lan');},handleBackupList:function(ev){return fs.exec('/sbin/sysupgrade',['--list-backup']).then(function(res){if(res.code!=0){ui.addNotification(null,[E('p',_('The sysupgrade command failed wit
h code %d').format(res.code)),res.stderr?E('pre',{},[res.stderr]):'']);L.raise('Error','Sysupgrade failed');}
/rom/www/luci-static/resources/view/system/flash.js
518:                    "192.168.1.100 8080",
/usr/lib/lua/luci/model/cbi/openvpn-advanced.lua
36:             "192.168.1.1 255.255.255.0 192.168.1.128 192.168.1.254",
/usr/lib/lua/luci/model/cbi/openvpn-basic.lua
4829:           -p 192.168.1.1
/usr/bin/etherwake