你的位置:首页 > 操作系统

[操作系统]Ubuntu无线转有线教程

本来想测试一下有线转无线的,奈何网卡不支持,所以就测试了一回无线转有线的测试!(真无聊,不过也算学习一下linux网桥的知识)

 

[email protected]:~$ sudo brctl addbr br0 [email protected]:~$ brctl show #查看网桥bridge name  bridge id  STP enabled  interfacesbr0  8000.000000000000  no

 

[email protected]:~$ sudo brctl addif br0 eth0 [email protected]:~$ sudo brctl delif br0 eth0 [email protected]:~$ brctl show #查看bridge name  bridge id  STP enabled  interfacesbr0  8000.00e04c0e681a  no  eth0

 

[email protected]:~$ sudo ifconfig br0 192.168.20.2 up [email protected]:~$ ip addr1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope host valid_lft forever preferred_lft forever2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 1000link/ether 00:e0:4c:0e:68:1a brd ff:ff:ff:ff:ff:ff3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000link/ether c8:e7:d8:fd:9c:78 brd ff:ff:ff:ff:ff:ffinet 192.168.90.102/24 brd 192.168.90.255 scope global wlan0valid_lft forever preferred_lft foreverinet6 fe80::cae7:d8ff:fefd:9c78/64 scope link valid_lft forever preferred_lft forever4: br0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default link/ether 00:e0:4c:0e:68:1a brd ff:ff:ff:ff:ff:ffinet 192.168.20.2/24 brd 192.168.20.255 scope global br0valid_lft forever preferred_lft fore

  

[email protected]:~$ sudo apt-get install isc-dhcp-server  # [email protected]:~$ sudo vi /etc/default/isc-dhcp-serverINTERFACES="br0"[email protected]:~$ sudo cp /etc/dhcp/dhcpd.conf [email protected]:~$ sudo vi /etc/dhcp/dhcpd.confsubnet 192.168.20.0 netmask 255.255.255.0 {range 192.168.20.100 192.168.20.200;option broadcast-address 192.168.2.255;default-lease-time 600;max-lease-time 7200;[email protected]:~$ sudo /etc/init.d/isc-dhcp-server start* Starting ISC DHCP server dhcpd [ OK ]

 

[email protected]:~$ ifconfig br0 down [email protected]:~$ sudo brctl delbr br0  #删除虚拟接口

 

[email protected]:~$ ifconfig br0 down [email protected]:~$ sudo brctl delbr br0  #删除虚拟接口