Lan networking¶
Pregled svih mrežnih interfejsa¶
Pogledajmo stanje mrežnih interfejsa, kada imamo podignut i wireless i lan, i ppp (wan, freezone)
root@router-wan-sa-1:~# ifconfig
br-lan Link encap:Ethernet HWaddr 00:1D:7E:55:69:5C inet addr:192.168.45.254 Bcast:192.168.45.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:436311 errors:0 dropped:0 overruns:0 frame:0 TX packets:390354 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:212727617 (202.8 MiB) TX bytes:140537613 (134.0 MiB) eth0 Link encap:Ethernet HWaddr 00:1D:7E:55:69:5C UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1698619 errors:0 dropped:0 overruns:0 frame:0 TX packets:949126 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:443283015 (422.7 MiB) TX bytes:352534931 (336.2 MiB) Interrupt:4 eth0.0 Link encap:Ethernet HWaddr 00:1D:7E:55:69:5C UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1173132 errors:0 dropped:0 overruns:0 frame:0 TX packets:384191 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:270719292 (258.1 MiB) TX bytes:123790848 (118.0 MiB) eth0.1 Link encap:Ethernet HWaddr 00:1D:7E:55:69:5C UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:525499 errors:0 dropped:0 overruns:0 frame:0 TX packets:564942 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:141989391 (135.4 MiB) TX bytes:220094198 (209.8 MiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:1 errors:0 dropped:0 overruns:0 frame:0 TX packets:1 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:89 (89.0 B) TX bytes:89 (89.0 B) ppp0 Link encap:Point-to-Point Protocol inet addr:89.146.140.11 P-t-P:89.146.128.1 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1 RX packets:8574 errors:0 dropped:0 overruns:0 frame:0 TX packets:9224 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:3673723 (3.5 MiB) TX bytes:3773085 (3.5 MiB) ppp1 Link encap:Point-to-Point Protocol inet addr:10.0.77.124 P-t-P:10.0.0.1 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1 RX packets:16268 errors:0 dropped:0 overruns:0 frame:0 TX packets:16692 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:10800056 (10.2 MiB) TX bytes:1345330 (1.2 MiB) wds0.1 Link encap:Ethernet HWaddr 00:1D:7E:55:69:5E UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) wds0.2 Link encap:Ethernet HWaddr 00:1D:7E:55:69:5E UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) wl0 Link encap:Ethernet HWaddr 00:1D:7E:55:69:5E UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:61699 errors:0 dropped:0 overruns:0 frame:114363 TX packets:1564817 errors:749864 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:11630642 (11.0 MiB) TX bytes:167662361 (159.8 MiB) Interrupt:2 Base address:0x5000
LAN interfejs (br-lan)¶
sve te informacije nalaze se u /etc/config/network
default-na konfiguracija vlan-ova
config 'switch' 'eth0' option 'vlan0' '0 1 2 3 5*' option 'vlan1' '4 5' config 'interface' 'loopback' option 'ifname' 'lo' option 'proto' 'static' option 'ipaddr' '127.0.0.1' option 'netmask' '255.0.0.0'
ovo je varijabilni dio:
config 'interface' 'lan' option 'type' 'bridge' option 'ifname' 'eth0.0' option 'proto' 'static' option 'ipaddr' '192.168.45.254' option 'netmask' '255.255.255.0' option 'dns' '192.168.45.250'