Substitua o ifconfig pois este está sendo eliminado do pacote iproute2;
root@bensley-n2:~# ip address show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
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: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
link/ether 00:e0:4c:6d:0a:49 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 74:ea:3a:ad:2e:00 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.5/24 brd 192.168.0.255 scope global wlan0
inet6 fe80::76ea:3aff:fead:2e00/64 scope link
valid_lft forever preferred_lft forever
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
link/ether ce:70:78:f8:10:75 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
root@bensley-n2:~# ip address add 1.1.1.1/24 dev wlan0
root@bensley-n2:~# ip address show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
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: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
link/ether 00:e0:4c:6d:0a:49 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 74:ea:3a:ad:2e:00 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.5/24 brd 192.168.0.255 scope global wlan0
inet 1.1.1.1/24 scope global wlan0
inet6 fe80::76ea:3aff:fead:2e00/64 scope link
valid_lft forever preferred_lft forever
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
link/ether ce:70:78:f8:10:75 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
root@bensley-n2:~# ip route show
default via 192.168.0.1 dev wlan0
1.1.1.0/24 dev wlan0 proto kernel scope link src 1.1.1.1
192.168.0.0/24 dev wlan0 proto kernel scope link src 192.168.0.5
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1
(Você pode abreviar os comandos ip
: ip address add
pode ser encurtado até ip a a
, e ip address show
pode ser encurtado para ip a s
. show
é a ação padrão se você não usa é possível especificar o segundo argumento, então você pode apenas digitar ip a
se você quiser ser bem conciso.)
Você não precisa adicionar uma rota para uma sub-rede local.