Skip to content

Instantly share code, notes, and snippets.

@adrienthebo
Created April 16, 2015 17:57
Show Gist options
  • Save adrienthebo/86b1be3df6e5acd6f4eb to your computer and use it in GitHub Desktop.
Save adrienthebo/86b1be3df6e5acd6f4eb to your computer and use it in GitHub Desktop.
[root@default ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 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: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:0f:d2:76 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0
inet6 fe80::a00:27ff:fe0f:d276/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:91:54:6e brd ff:ff:ff:ff:ff:ff
inet 10.20.1.25/24 brd 10.20.1.255 scope global eth1
inet6 fe80::a00:27ff:fe91:546e/64 scope link
valid_lft forever preferred_lft forever
[root@default ~]# ip addr delete 10.20.1.25/25 dev eth1
RTNETLINK answers: Cannot assign requested address
[root@default ~]# iptables -nvL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
129K 46M ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0
2325 139K ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
6 296 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
13 1096 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT 123K packets, 29M bytes)
pkts bytes target prot opt in out source destination
[root@default ~]# /etc/init.d/iptables stop
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
[root@default ~]# ip addr delete 10.20.1.25/25 dev eth1
RTNETLINK answers: Cannot assign requested address
[root@default ~]# iptables -nvL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
[root@default ~]# ip addr delete 10.20.1.25/24 dev eth1
[root@default ~]# ip addr show dev eth1
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:91:54:6e brd ff:ff:ff:ff:ff:ff
inet6 fe80::a00:27ff:fe91:546e/64 scope link
valid_lft forever preferred_lft forever
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment