Tag Info

New answers tagged

3

One-liners: nm-tool | grep -i gateway | xargs echo | cut -d' ' -f2 nm-tool | grep -i gateway | awk '{print $2} netstat -nr | awk '$1 == "0.0.0.0"{print$2}' arp -n | awk '{print $1}' Note: works only if your machine is the only one on the network ip route show | grep -i 'default via'| awk '{print $3 }' output: 192.168.0.1 for me Edits and additional info ...


5

As you usually use route -n, you can try this sed solution coupled with route -n: route -n | sed -nr 's/(0\.0\.0\.0) +([^ ]+) +\1.*/\2/p' Here is a test: $ route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0 169.254.0.0 ...


8

You can find it many ways ip route show default A better question, what or how do you want to shape the output ? ip route show | awk '/default/ {print $3}' tracepath -m 1 8.8.8.8 | awk '/1:/ {print $2}' | uniq From the comments -(thank you Avinash Raj 0 tracepath -m 1 8.8.8.8 | awk '/1:/ {print $2;exit}'


0

I would reconsider using your ISP as a IPv6 provider if they have not given you at least one IPv6 /64 net that is routed to you and one IPv6 address for your external interfacenfor your router. It could aldo benthe case that you have misunderstood what they given you. You need one IPv6 address on a net provided by your ISP for your external interface. ...


1

The size you should route to a subnet is a /64. Things like autoconfiguration don't work if you don't use a /64 per subnet. If you only get a single /64 from your ISP then you won't be able to route it in any convenient way. An ISP should give you a /48, or at least a /56, and route that whole prefix to your gateway router. Then you can create subnets and ...


0

You must set on router traffic forwarding. First allow fw on system with command sudo sh -c “echo 1 /proc/sys/net/ipv4/ip forward’’ and do some iptables fw rules sudo iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE sudo iptables -A FORWARD -i eth1 -o eth0 -m state -–state RELATED,ESTABLISHED -j ACCEPT sudo iptables -A FORWARD -i eth0 -o eth1 -j ...


1

According to the answer I get from muru, I found this workaround out: For find out the vender-class-identifier from the clients, you need to put this on top from the dhcpd.conf: set vendor-string = option vendor-class-identifier; After restarting the dhcp service and a new connection to the dhcp server from a client you can use cat ...



Top 50 recent answers are included