caiwang / board2ihost

0 stars 0 forks source link

radxa setup wlan0 #38

Open caiwang opened 9 years ago

caiwang commented 9 years ago

Issue by caiwang Sunday Mar 01, 2015 at 04:03 GMT Originally opened as https://github.com/caiwang/ihostsrc/issues/38


echo "auto wlan0 iface wlan0 inet static name Ethernet alias LAN card address 172.16.0.1 netmask 255.255.0.0 network 172.16.0.0 broadcast 172.16.255.255" > /etc/network/interfaces.d/wlan0

root@radxa:~# cat /etc/network/interfaces.d/wlan0 auto wlan0 iface wlan0 inet static name Ethernet alias LAN card address 172.16.0.1 netmask 255.255.0.0 network 172.16.0.0 broadcast 172.16.255.255 root@radxa:~#

reboot

result

[ 2.864318] usb 2-1.1: New USB device found, idVendor=0bda, idProduct=0724 [ 2.866112] usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 2.868001] usb 2-1.1: Product: 802.11n WLAN Adapter [ 2.869826] usb 2-1.1: Manufacturer: Realtek [ 2.871631] usb 2-1.1: SerialNumber: 00e04c000001

[ 10.117021] ADDRCONF(NETDEV_UP): eth0: link is not ready [ 12.113781] PHY: 0:00 - Link is Down [ 14.116001] PHY: 0:00 - Link is Up - 100/Full [ 14.116787] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready [ 19.629286] init: failsafe main process (580) killed by TERM signal [ 23.830528] init: plymouth-upstart-bridge main process ended, respawning [ 24.015666] init: tty1 main process (940) killed by TERM signal [ 24.473255] eth0: no IPv6 routers present

root@radxa:~# ifconfig eth0 Link encap:Ethernet HWaddr de:ad:de:ad:be:ef
inet addr:192.168.1.103 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::dcad:deff:fead:beef/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:124 errors:0 dropped:0 overruns:0 frame:0 TX packets:150 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:14139 (14.1 KB) TX bytes:49060 (49.0 KB) Interrupt:51

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:16436 Metric:1 RX packets:32 errors:0 dropped:0 overruns:0 frame:0 TX packets:32 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:2368 (2.3 KB) TX bytes:2368 (2.3 KB)

wlan0 Link encap:Ethernet HWaddr 54:e4:bd:10:19:f5
inet addr:172.16.0.1 Bcast:172.16.255.255 Mask:255.255.0.0 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)

root@radxa:~# ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether de:ad:de:ad:be:ef brd ff:ff:ff:ff:ff:ff inet 192.168.1.103/24 brd 192.168.1.255 scope global eth0 inet6 fe80::dcad:deff:fead:beef/64 scope link valid_lft forever preferred_lft forever 3: sit0: mtu 1480 qdisc noop state DOWN group default link/sit 0.0.0.0 brd 0.0.0.0 4: ip6tnl0: mtu 1452 qdisc noop state DOWN group default link/tunnel6 :: brd :: 5: wlan0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 54:e4:bd:10:19:f5 brd ff:ff:ff:ff:ff:ff inet 172.16.0.1/16 brd 172.16.255.255 scope global wlan0 root@radxa:~# ping 172.16.0.1 PING 172.16.0.1 (172.16.0.1) 56(84) bytes of data. 64 bytes from 172.16.0.1: icmp_seq=1 ttl=64 time=0.222 ms 64 bytes from 172.16.0.1: icmp_seq=2 ttl=64 time=0.164 ms

caiwang commented 9 years ago

Comment by caiwang Sunday Mar 01, 2015 at 05:41 GMT


no network manager

root@radxa:~# service network-manager start network-manager: unrecognized service

caiwang commented 9 years ago

Comment by caiwang Sunday Mar 01, 2015 at 06:20 GMT


echo "auto wlan0 iface wlan0 inet dhcp" > /etc/network/interfaces.d/wlan0

reboot

dmesg

[ 2.775380] usb 2-1.1: new high speed USB device number 3 using usb20_host [ 2.874451] usb 2-1.1: New USB device found, idVendor=0bda, idProduct=0724 [ 2.877410] usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 2.879410] usb 2-1.1: Product: 802.11n WLAN Adapter [ 2.881355] usb 2-1.1: Manufacturer: Realtek [ 2.883389] usb 2-1.1: SerialNumber: 00e04c000001

[ 8.858510] ADDRCONF(NETDEV_UP): eth0: link is not ready [ 9.530378] ADDRCONF(NETDEV_UP): wlan0: link is not ready [ 10.853956] PHY: 0:00 - Link is Down [ 11.544046] RTL8723AU: ERROR nolinked power save enter [ 12.856057] PHY: 0:00 - Link is Up - 100/Full [ 12.856838] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready [ 23.373321] eth0: no IPv6 routers present

root@radxa:~# ifconfig eth0 Link encap:Ethernet HWaddr de:ad:de:ad:be:ef
inet addr:192.168.1.103 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::dcad:deff:fead:beef/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:381 errors:0 dropped:0 overruns:0 frame:0 TX packets:315 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:34515 (34.5 KB) TX bytes:103490 (103.4 KB) Interrupt:51

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:16436 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:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

wlan0 Link encap:Ethernet HWaddr 54:e4:bd:10:19:f5
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)

root@radxa:~# ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether de:ad:de:ad:be:ef brd ff:ff:ff:ff:ff:ff inet 192.168.1.103/24 brd 192.168.1.255 scope global eth0 inet6 fe80::dcad:deff:fead:beef/64 scope link valid_lft forever preferred_lft forever 3: sit0: mtu 1480 qdisc noop state DOWN group default link/sit 0.0.0.0 brd 0.0.0.0 4: ip6tnl0: mtu 1452 qdisc noop state DOWN group default link/tunnel6 :: brd :: 5: wlan0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 54:e4:bd:10:19:f5 brd ff:ff:ff:ff:ff:ff

caiwang commented 9 years ago

Comment by caiwang Sunday Mar 01, 2015 at 06:34 GMT


最简设置

echo "auto wlan0 iface wlan0 inet static address 172.16.0.1 netmask 255.255.0.0" > /etc/network/interfaces.d/wlan0

[ 8.770325] ADDRCONF(NETDEV_UP): eth0: link is not ready [ 9.507299] ADDRCONF(NETDEV_UP): wlan0: link is not ready [ 10.764208] PHY: 0:00 - Link is Down [ 11.523730] RTL8723AU: ERROR nolinked power save enter [ 12.766025] PHY: 0:00 - Link is Up - 100/Full [ 12.766809] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready [ 13.725434] init: failsafe main process (535) killed by TERM signal [ 17.906108] init: plymouth-upstart-bridge main process ended, respawning [ 18.080671] init: tty1 main process (936) killed by TERM signal [ 23.073245] eth0: no IPv6 routers present

root@radxa:~# ifconfig eth0 Link encap:Ethernet HWaddr de:ad:de:ad:be:ef
inet addr:192.168.1.103 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::dcad:deff:fead:beef/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:134 errors:0 dropped:0 overruns:0 frame:0 TX packets:178 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:14821 (14.8 KB) TX bytes:49734 (49.7 KB) Interrupt:51

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:16436 Metric:1 RX packets:16 errors:0 dropped:0 overruns:0 frame:0 TX packets:16 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1184 (1.1 KB) TX bytes:1184 (1.1 KB)

wlan0 Link encap:Ethernet HWaddr 54:e4:bd:10:19:f5
inet addr:172.16.0.1 Bcast:172.16.255.255 Mask:255.255.0.0 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)

root@radxa:~# ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether de:ad:de:ad:be:ef brd ff:ff:ff:ff:ff:ff inet 192.168.1.103/24 brd 192.168.1.255 scope global eth0 inet6 fe80::dcad:deff:fead:beef/64 scope link valid_lft forever preferred_lft forever 3: sit0: mtu 1480 qdisc noop state DOWN group default link/sit 0.0.0.0 brd 0.0.0.0 4: ip6tnl0: mtu 1452 qdisc noop state DOWN group default link/tunnel6 :: brd :: 5: wlan0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 54:e4:bd:10:19:f5 brd ff:ff:ff:ff:ff:ff inet 172.16.0.1/16 brd 172.16.255.255 scope global wlan0 root@radxa:~#

root@radxa:~# ping 172.16.0.1 PING 172.16.0.1 (172.16.0.1) 56(84) bytes of data. 64 bytes from 172.16.0.1: icmp_seq=1 ttl=64 time=0.236 ms 64 bytes from 172.16.0.1: icmp_seq=2 ttl=64 time=0.192 ms

caiwang commented 9 years ago

Comment by caiwang Sunday Mar 01, 2015 at 07:08 GMT


eth0两个ip地址的设置

https://sfxpt.wordpress.com/2014/05/11/use-dbab-under-ubuntu-14-04-trusty/

% cat /etc/network/interfaces

interfaces(5) file used by ifup(8) and ifdown(8)

Include files from /etc/network/interfaces.d:

source-directory /etc/network/interfaces.d

auto eth0 iface eth0 inet static address 192.168.2.100 netmask 255.255.255.0 gateway 192.168.2.1

add a 2nd ip address

    post-up ip addr add dev eth0 192.168.2.101/24
    pre-down ip addr del dev eth0 192.168.2.101/24