rpcbind - is there really no way to make the tcp ports bind to a specific interface / can nfs be ran without rpcbind?
The rpcbind is required to map RPC service to network ( read TCP or UDP ) address and port. NFS versions 2 and 3 require an additional service mountd to allow clients to get initial file handle. While nfs has a well know port number 2049, mountd doesn't. IOW, if you want to use NFSv3 you will need to run rpcbind as well (well, there are probably some mount options to tell where mound is running). In opposite to v3, NFSv4 requires only single port 2049 and does not need mountd at all. This makes rpcbind free NFS setup possible. Just be aware, that some (old) clients may still try to talk to rpcbind even for v4.
Now, about rpcbind. Why you want to protect it? If it's not available to clients, then they cant mount? The only reason to protect is to limit number of clients which can do updates. But this is already in place as rpcbind uses unix domain socket and disallow any remote client perform updates. Even on a local host you need to be root for that. If you want to protect from some clients only, then iptables is your friend (or what ever firewall your OS has):
# iptables -A INPUT -s 10.1.2.0/24 -p tcp --dport 111 -j ACCEPT
# iptables -A INPUT -s 10.1.3.0/24 -p udp --dport 111 -j ACCEPT
# iptables -A INPUT -p tcp --dport 111 -j DROP
# iptables -A INPUT -p udp --dport 111 -j DROP
Related videos on Youtube
Tanuj
Updated on September 18, 2022Comments
-
Tanuj almost 2 years
I need to get Serial number in my table. I am using ng-table in angularjs to get the pagination controls. In my first column of the table I am using {{$index+1}} to display the serial number. But when I navigate to next page again the serial number starts from 1 instead of 11. Here is my code:
HTML
<body ng-app="main"> <div ng-controller="DemoCtrl"> <p><strong>Page:</strong> {{tableParams.page()}}</p> <p><strong>Count per page:</strong> {{tableParams.count()}}</p> <table ng-table="tableParams" class="table"> <tr ng-repeat="user in $data"> <td>{{$index+1}}</td> <td data-title="'Name'">{{user.name}}</td> <td data-title="'Age'">{{user.age}}</td> </tr> </table> </div>
JS
var app = angular.module('main', ['ngTable']).controller('DemoCtrl', function($scope, ngTableParams) { var data = [{name: "Moroni", age: 50}, {name: "Tiancum", age: 43}, {name: "Jacob", age: 27}, {name: "Nephi", age: 29}, {name: "Enos", age: 34}, {name: "Tiancum", age: 43}, {name: "Jacob", age: 27}, {name: "Nephi", age: 29}, {name: "Enos", age: 34}, {name: "Tiancum", age: 43}, {name: "Steve", age: 27}, {name: "Adam", age: 29}, {name: "Mark", age: 34}, {name: "Ricky", age: 43}, {name: "Peter", age: 27}, {name: "Matthew", age: 29}, {name: "Smith", age: 34}]; $scope.tableParams = new ngTableParams({ page: 1, // show first page count: 10 // count per page }, { total: data.length, // length of data getData: function($defer, params) { $defer.resolve(data.slice((params.page() - 1) * params.count(), params.page() * params.count())); } });
});
Please check this plunker for the issue:
-
Tanuj over 7 yearsThanks @Kursad Gulseven for the quick response :)
-
Kursad Gulseven over 7 yearsYou're welcome. Please select it if it's useful. ;) meta.stackexchange.com/questions/5234/…
-
Michael Hampton over 5 yearsThe OP noted that
-h
only applied to UDP ports, not TCP ports. When did this change? -
Daniel Lo Nigro about 5 yearsAlso, if you're only using NFSv4 (not NFSv2 or NFSv3), you can use the
-H
option torpc.nfsd
to bind to one particular IP. For example, in/etc/default/nfs-kernel-server
on Debian or Ubuntu:RPCNFSDOPTS="-N 2 -N 3 -H 10.20.1.1"
-
wedi over 4 years@DanielLoNigro It would be cool if you could extend on that in a dedicated answer as I am struggling to find a solution for this, too.